+Changes in 3.0.2
+================
+* NEW: afpd: Put file extension type/creator mapping back in which had
+ been removed in 3.0.
+* NEW: afpd: new option 'ad domain'. From FR #66.
+* UPD: ignore volumes with duplicated volumes paths.
+* FIX: volumes and home share with symlinks in the path
+* FIX: Copying packages to a Netatalk share could fail, bug #469
+* FIX: Reloading volumes from config file was broken.
+ Fixes bug #474.
+* FIX: Fix _device-info service type registered with dns-sd API
+* FIX: Fix pathname bug for FCE modified event.
+* FIX: "valid users" options and friends only use ',' as field delimiter.
+ Fixes bug #472.
+* FIX: Remove length limitation of options like "valid users".
+ Fixes bug #473.
+* REM: Remove TimeMachine volume used size FCE event.
+
Changes in 3.0.1
================
* NEW: afpd: Optional "ldap uuid encoding = string | ms-guid" parameter to
* FIX: handling of '/' and ':' in volume name
* UPD: Install relevant includes necessary for building programs with
installed headers and shared lib libatalk
+* UPD: libevent configure args to pick up installed version. Removed
+ configure arg --disable-libevent, added configure args
+ --with-libevent-header|lib.
+* UPD: gentoo initscript: merge from portage netatalk.init,v 1.1
* REM: Remove --with-smbsharemodes configure option, it was an
empty stub not yet implemented
-stp2
\ No newline at end of file
+stp3dev
\ No newline at end of file
setuplog("default:note", "/dev/tty");
- if (load_volumes(&obj, NULL) != 0)
+ if (load_volumes(&obj) != 0)
return 1;
if (STRCMP(argv[1], ==, "ls"))
"FCE_FILE_DELETE",
"FCE_DIR_DELETE",
"FCE_FILE_CREATE",
- "FCE_DIR_CREATE",
- "FCE_TM_SIZE"
+ "FCE_DIR_CREATE"
};
// get sockaddr, IPv4 or IPv6:
packet->datalen = ntohs(packet->datalen);
memcpy(&packet->data[0], p, packet->datalen);
+ packet->data[packet->datalen] = 0; /* 0 terminate strings */
p += packet->datalen;
return 0;
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;
TMPLFILES = afp.conf.tmpl dbus-session.conf.tmpl
GENFILES = afp.conf dbus-session.conf
CLEANFILES = $(GENFILES)
-EXTRA_DIST = afp.conf.tmpl dbus-session.conf.tmpl
+EXTRA_DIST = afp.conf.tmpl extmap.conf dbus-session.conf.tmpl
OVERWRITE_CONFIG = @OVERWRITE_CONFIG@
-CONFFILES =
+CONFFILES = extmap.conf
pkgconfdir = @PKGCONFDIR@
#
--- /dev/null
+# 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
dnl search for necessary libraries
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(connect, socket)
-AC_SEARCH_LIBS(pthread_sigmask, pthread,,[AC_MSG_ERROR([missing pthread_sigmask])])
-if test x"$ac_cv_search_pthread_sigmask" != x"none required" ; then
- PTHREAD_LIBS=$ac_cv_search_pthread_sigmask
-fi
-AC_SUBST(PTHREAD_LIBS)
+AX_PTHREAD(, [AC_MSG_ERROR([missing pthread_sigmask])])
AC_DEFINE(OPEN_NOFOLLOW_ERRNO, ELOOP, errno returned by open with O_NOFOLLOW)
use File::Spec;
use File::Temp qw /tempfile/;
use bigint; # require perl >= 5.8
+use IPC::Open2 qw /open2/;
# check command for extended attributes -----------------------------------
if ( 0 == system("which getfattr > /dev/null 2>&1")) {
$eacommand = 1;
-} elsif (0 == system("which xattr > /dev/null 2>&1")) {
+} elsif (0 == system("which attr > /dev/null 2>&1")) {
$eacommand = 2;
} elsif (0 == system("which runat > /dev/null 2>&1")) {
$eacommand = 3;
} elsif ($arg eq "-e") {
if ($eacommand == 0) {
printf (STDERR "%s: unsupported option -e\n", basename($0));
- printf (STDERR "because neither getfattr, xattr nor runat is found.\n");
+ printf (STDERR "because neither getfattr, attr, runat nor getextattr is found.\n");
exit 1;
}
$eaoption = 1;
sub checkea {
my ($file) = @_;
- $file =~ s/\\/\\\\/g;
- $file =~ s/\"/\\\"/g;
- $file =~ s/\$/\\\$/g;
- $file =~ s/\`/\\\`/g;
if ( $eacommand == 1 ) {
- open(EALIST, "getfattr \"$file\" |");
+ open2(\*EALIST, \*EAIN, 'getfattr', $file) or die $@;
while(<EALIST>) {
if ( $_ eq "user.org.netatalk.Metadata\n" ) {
- close (EALIST);
+ close (EALIST, EAIN);
return 1;
}
}
- close (EALIST);
+ close (EALIST, EAIN);
return 0;
} elsif ( $eacommand == 2 ) {
- open(EALIST, "attr -q -l \"$file\" |");
+ open2(\*EALIST, \*EAIN, 'attr', '-q', '-l', $file) or die $@;
while(<EALIST>) {
if ( $_ eq "org.netatalk.Metadata\n" ) {
- close (EALIST);
+ close (EALIST, EAIN);
return 1;
}
}
- close (EALIST);
+ close (EALIST, EAIN);
return 0;
} elsif ( $eacommand == 3 ) {
- open(EALIST, "runat \"$file\" ls -1 |");
+ open2(\*EALIST, \*EAIN, 'runat', $file, 'ls', '-1') or die $@;
while(<EALIST>) {
if ( $_ eq "org.netatalk.Metadata\n" ) {
- close (EALIST);
+ close (EALIST, EAIN);
return 1;
}
}
- close (EALIST);
+ close (EALIST, EAIN);
return 0;
} elsif ( $eacommand == 4 ) {
- open(EALIST, "lsextattr -q user \"$file\" |");
+ open2(\*EALIST, \*EAIN, 'lsextattr', '-q', 'user', $file) or die $@;
while(<EALIST>) {
$_ = "\t".$_;
if ( $_ =~ /\torg\.netatalk\.Metadata[\n\t]/ ) {
- close (EALIST);
+ close (EALIST, EAIN);
return 1;
}
}
- close (EALIST);
+ close (EALIST, EAIN);
return 0;
} else {
return 0;
sub eaopenfile {
my ($file) = @_;
-
- $file =~ s/\\/\\\\/g;
- $file =~ s/\"/\\\"/g;
- $file =~ s/\$/\\\$/g;
- $file =~ s/\`/\\\`/g;
- ($eatempfh, $eatempfile) = tempfile(UNLINK => 1);
+ my @eacommands = ();
if ( $eacommand == 1 ) {
- system("getfattr --only-values -n user.org.netatalk.Metadata \"$file\" > $eatempfile");
+ @eacommands = ('getfattr', '--only-values', '-n', 'user.org.netatalk.Metadata', $file);
} elsif ( $eacommand == 2 ) {
- system("attr -q -g org.netatalk.Metadata \"$file\" > $eatempfile");
+ @eacommands = ('attr', '-q', '-g', 'org.netatalk.Metadata', $file);
} elsif ( $eacommand == 3 ) {
- system("runat \"$file\" cat org.netatalk.Metadata > $eatempfile");
+ @eacommands = ('runat', $file, 'cat', 'org.netatalk.Metadata',);
} elsif ( $eacommand == 4 ) {
- system("getextattr -q user org.netatalk.Metadata \"$file\" > $eatempfile");
+ @eacommands = ('getextattr', '-q', 'user', 'org.netatalk.Metadata', $file);
} else {
return "";
}
+ my ($eatempfh, $eatempfile) = tempfile(UNLINK => 1);
+ open2(my $ealist, my $eain, @eacommands) or die $@;
+ print $eatempfh $_ while(<$ealist>);
+ close($ealist, $eain);
close($eatempfh);
return $eatempfile;
}
CLEANFILES = $(GENERATED_FILES) $(sysv_SCRIPTS) $(service_DATA) afpd cnid_metad
EXTRA_DIST = $(TEMPLATES)
+noinst_DATA = $(GENERATED_FILES)
# overwrite automake uninstall
# not beautiful, but this way we can call the OS specific init script
#!/sbin/runscript
-
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+#
# Netatalk :NETATALK_VERSION: daemons.
-depend() {
- need net
- use logger dns
-}
-
-netatalk_startup () {
- ebegin "Starting netatalk"
- start-stop-daemon --start --quiet --exec :SBINDIR:/netatalk
- eend $?
-}
-
-start () {
- netatalk_startup
-}
+command=":SBINDIR:/${SVCNAME}"
-stop () {
- ebegin "Stopping netatalk"
- start-stop-daemon --stop --quiet --exec :SBINDIR:/netatalk
- eend $?
+depend() {
+ need net
+ use avahi-daemon
+ use logger dns
+ after entropy
}
[Unit]
Description=Netatalk AFP fileserver for Macintosh clients
+Documentation=man:afp.conf(5) man:netatalk(8) man:afpd(8) man:cnid_metad(8) man:cnid_dbd(8)
+Documentation=http://netatalk.sourceforge.net/
After=syslog.target network.target avahi-daemon.service
[Service]
file.c \
filedir.c \
fork.c \
- gettok.c \
hash.c \
main.c \
mangle.c \
afpd_LDFLAGS = -export-dynamic
afpd_CFLAGS = \
- @ZEROCONF_CFLAGS@ @GSSAPI_CFLAGS@ @KRB5_CFLAGS@\
+ @ZEROCONF_CFLAGS@ @GSSAPI_CFLAGS@ @KRB5_CFLAGS@ @PTHREAD_CFLAGS@\
-DAPPLCNAME \
-DSERVERTEXT=\"$(SERVERTEXT)/\" \
-D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\" \
/*!
- * Free and cleanup all linked DSI objects from config
+ * Free and cleanup config and DSI
*
- * Preserve object pointed to by "dsi".
- * "dsi" can be NULL in which case all DSI objects _and_ the options object are freed
+ * "dsi" can be NULL in which case all DSI objects and the config object is freed,
+ * otherwise its an afpd session child and only any unneeded DSI objects are freed
*/
void configfree(AFPObj *obj, DSI *dsi)
{
DSI *p, *q;
- /* the master loaded the volumes for zeroconf, get rid of that */
- unload_volumes(obj);
+ if (!dsi) {
+ /* Master afpd reloading config */
+ auth_unload();
+ if (! (obj->options.flags & OPTION_NOZEROCONF)) {
+ unload_volumes(obj);
+ zeroconf_deregister();
+ }
+ }
+ /* Master and child releasing unneeded DSI handles */
for (p = obj->dsi; p; p = q) {
q = p->next;
if (p == dsi)
continue;
- close(p->socket);
+ dsi_free(p);
free(p);
}
+ obj->dsi = NULL;
+ /* afpd session child passes dsi handle to obj handle */
if (dsi) {
dsi->next = NULL;
obj->dsi = dsi;
- } else {
- afp_options_free(&obj->options);
}
}
auth_load(obj->options.uampath, obj->options.uamlist);
set_signature(&obj->options);
+#ifdef HAVE_LDAP
+ acl_ldap_freeconfig();
+#endif /* HAVE_LDAP */
LOG(log_debug, logtype_afpd, "DSIConfigInit: hostname: %s, listen: %s, port: %s",
obj->options.hostname,
/* Now register with zeroconf, we also need the volumes for that */
if (! (obj->options.flags & OPTION_NOZEROCONF)) {
- load_volumes(obj, NULL);
+ load_volumes(obj);
zeroconf_register(obj);
}
if (reload_request) {
reload_request = 0;
- load_volumes(AFPobj, closevol);
+ load_volumes(AFPobj);
}
/* The first SIGINT enables debugging, the next restores the config */
free(str); free(key); \
}
+static struct pollfd *fds;
/*
* This is the thread that polls the filehandles
*/
-void *polling_thread(void *arg) {
+static void *polling_thread(void *arg) {
// First we loop through getting the filehandles and adding them to our poll, we
// need to allocate our pollfd's
DNSServiceErrorType error;
- struct pollfd *fds = calloc(svc_ref_count, sizeof(struct pollfd));
+ fds = calloc(svc_ref_count, sizeof(struct pollfd));
assert(fds);
for(int i=0; i < svc_ref_count; i++) {
return(NULL);
}
-
/*
* This is the callback for the service register function ... actually there isn't a lot
* we can do if we get problems, so we don't really need to do anything other than report
* the issue.
*/
-void RegisterReply(DNSServiceRef sdRef, DNSServiceFlags flags, DNSServiceErrorType errorCode,
- const char *name, const char *regtype, const char *domain, void *context) {
-
- if(errorCode != kDNSServiceErr_NoError) {
+static void RegisterReply(DNSServiceRef sdRef, DNSServiceFlags flags, DNSServiceErrorType errorCode,
+ const char *name, const char *regtype, const char *domain, void *context)
+{
+ if (errorCode != kDNSServiceErr_NoError) {
LOG(log_error, logtype_afpd, "Failed to register mDNS service: %s%s%s: code=%d",
name, regtype, domain, errorCode);
}
}
-
/*
* This function unregisters anything we have already
* registered and frees associated memory
*/
static void unregister_stuff() {
- pthread_kill(poller, SIGKILL);
+ pthread_cancel(poller);
+
+ for (int i = 0; i < svc_ref_count; i++)
+ close(fds[i].fd);
+ free(fds);
+ fds = NULL;
+
if(svc_refs) {
for(int i=0; i < svc_ref_count; i++) {
DNSServiceRefDeallocate(svc_refs[i]);
LOG(log_info, logtype_afpd, "Registering server '%s' with model '%s'",
dsi->bonjourname, obj->options.mimicmodel);
TXTRecordCreate(&txt_devinfo, 0, NULL);
- TXTRecordPrintf(&txt_devinfo, "model=%s", obj->options.mimicmodel);
+ TXTRecordPrintf(&txt_devinfo, "model", obj->options.mimicmodel);
error = DNSServiceRegister(&svc_refs[svc_ref_count++],
0, // no flags
0, // all network interfaces
DEV_INFO_SERVICE_TYPE,
"", // default domains
NULL, // default host name
- 0,
+ /*
+ * We would probably use port 0 zero, but we can't, from man DNSServiceRegister:
+ * "A value of 0 for a port is passed to register placeholder services.
+ * Place holder services are not found when browsing, but other
+ * clients cannot register with the same name as the placeholder service."
+ * We therefor use port 9 which is used by the adisk service type.
+ */
+ htons(9),
TXTRecordGetLength(&txt_devinfo),
TXTRecordGetBytesPtr(&txt_devinfo),
RegisterReply, // callback
#define LENGTH 512
-/* get rid of any allocated afp_option buffers. */
-void afp_options_free(struct afp_options *opt)
-{
- if (opt->hostname)
- free(opt->hostname);
- if (opt->adminauthuser)
- free(opt->adminauthuser);
- if (opt->configfile)
- free(opt->configfile);
- if (opt->fqdn)
- free(opt->fqdn);
- if (opt->guest)
- free(opt->guest);
- if (opt->listen)
- free(opt->listen);
- if (opt->k5realm)
- free(opt->k5realm);
- if (opt->k5keytab)
- free(opt->k5keytab);
- if (opt->k5service)
- free(opt->k5service);
- if (opt->logconfig)
- free(opt->logconfig);
- if (opt->logfile)
- free(opt->logfile);
- if (opt->loginmesg)
- free(opt->loginmesg);
- if (opt->maccodepage)
- free(opt->maccodepage);
- if (opt->mimicmodel)
- free(opt->mimicmodel);
- if (opt->ntdomain)
- free(opt->ntdomain);
- if (opt->ntseparator)
- free(opt->ntseparator);
- if (opt->passwdfile)
- free(opt->passwdfile);
- if (opt->port)
- free(opt->port);
- if (opt->signatureopt)
- free(opt->signatureopt);
- if (opt->uamlist)
- free(opt->uamlist);
- if (opt->uampath)
- free(opt->uampath);
- if (opt->unixcodepage)
- free(opt->unixcodepage);
-}
-
/*
* Show version information about afpd.
* Used by "afp -v".
static void show_paths( void )
{
printf( " afp.conf:\t%s\n", _PATH_CONFDIR "afp.conf");
+ printf( " extmap.conf:\t%s\n", _PATH_CONFDIR "extmap.conf");
printf( " state directory:\t%s\n", _PATH_STATEDIR);
printf( " afp_signature.conf:\t%s\n", _PATH_STATEDIR "afp_signature.conf");
printf( " afp_voluuid.conf:\t%s\n", _PATH_STATEDIR "afp_voluuid.conf");
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);
+ fce_register(FCE_DIR_CREATE, bdata(curdir->d_fullpath), NULL, fce_dir);
ad_flush(&ad);
ad_close(&ad, ADFLAGS_HF);
/*
* Copyright (c) 2010 Mark Williams
+ * Copyright (c) 2012 Frank Lahm <franklahm@gmail.com>
*
* File change event API for netatalk
*
#include <stdlib.h>
#include <errno.h>
#include <time.h>
-
-
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
+#include <stdbool.h>
#include <atalk/adouble.h>
#include <atalk/vfs.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 bool udp_initialized = false;
static unsigned long fce_ev_enabled =
(1 << FCE_FILE_MODIFY) |
(1 << FCE_FILE_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[] =
};
static struct fce_close_event last_close_event;
+static char *fce_event_names[] = {
+ "",
+ "FCE_FILE_MODIFY",
+ "FCE_FILE_DELETE",
+ "FCE_DIR_DELETE",
+ "FCE_FILE_CREATE",
+ "FCE_DIR_CREATE"
+};
+
/*
*
* Initialize network structs for any listeners
int rv;
struct addrinfo hints, *servinfo, *p;
- if (udp_initialized == FCE_TRUE)
+ if (udp_initialized == true)
return;
memset(&hints, 0, sizeof hints);
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",
+ LOG(log_error, logtype_fce, "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",
+ LOG(log_error, logtype_fce, "fce_init_udp: socket(%s:%s): %s",
udp_entry->addr, udp_entry->port, strerror(errno));
continue;
}
}
if (p == NULL) {
- LOG(log_error, logtype_afpd, "fce_init_udp: no socket for %s:%s",
+ LOG(log_error, logtype_fce, "fce_init_udp: no socket for %s:%s",
udp_entry->addr, udp_entry->port);
}
udp_entry->addrinfo = *p;
freeaddrinfo(servinfo);
}
- udp_initialized = FCE_TRUE;
+ udp_initialized = true;
}
void fce_cleanup()
{
- if (udp_initialized == FCE_FALSE )
+ if (udp_initialized == false )
return;
for (int i = 0; i < udp_sockets; i++)
udp_entry->sock = -1;
}
}
- udp_initialized = FCE_FALSE;
+ udp_initialized = 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 )
+static ssize_t build_fce_packet( struct fce_packet *packet, const char *path, int event, uint32_t event_id )
{
size_t pathlen = 0;
ssize_t data_len = 0;
/* Set content of packet */
memcpy(packet->magic, FCE_PACKET_MAGIC, sizeof(packet->magic) );
packet->version = FCE_PACKET_VERSION;
- packet->mode = mode;
+ packet->mode = event;
packet->event_id = event_id;
/* 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;
- }
+ memcpy(packet->data, path, pathlen);
/* return the packet len */
return data_len;
* 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 void send_fce_event(const char *path, int event)
{
- static int first_event = FCE_TRUE;
+ static bool first_event = 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");
+ LOG(log_debug, logtype_fce, "send_fce_event: start");
/* initialized ? */
- if (first_event == FCE_TRUE) {
- first_event = FCE_FALSE;
+ if (first_event == true) {
+ first_event = 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 );
+ ssize_t data_len = build_fce_packet( &packet, path, event, ++event_id );
pack_fce_packet(&packet, iobuf, MAXIOBUF);
for (int i = 0; i < udp_sockets; i++)
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 );
+ LOG(log_error, logtype_fce, "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->addrinfo.ai_addrlen);
/* Rebuild our original data packet */
- data_len = build_fce_packet( &packet, path, mode, event_id );
+ data_len = build_fce_packet(&packet, path, event, event_id);
pack_fce_packet(&packet, iobuf, MAXIOBUF);
}
/* 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",
+ LOG(log_error, logtype_fce, "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 );
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 );
+ LOG(log_error, logtype_fce, "Too many file change api UDP connections (max %d allowed)", FCE_MAX_UDP_SOCKS );
return AFPERR_PARAM;
}
send_fce_event(last_close_event.path, FCE_FILE_MODIFY);
}
- LOG(log_debug, logtype_afpd, "save_close_event: %s", path);
+ LOG(log_debug, logtype_fce, "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)
+int fce_register(fce_ev_t event, const char *path, const char *oldpath, fce_obj_t type)
{
- static int first_event = FCE_TRUE;
+ static bool first_event = true;
+ const char *bname;
+
+ if (!(fce_ev_enabled & (1 << event)))
+ return AFP_OK;
+
+ AFP_ASSERT(event >= FCE_FIRST_EVENT && event <= FCE_LAST_EVENT);
+
+ LOG(log_debug, logtype_fce, "register_fce(path: %s, type: %s, event: %s",
+ path , type == fce_dir ? "dir" : "file", fce_event_names[event]);
+
+ bname = basename_safe(path);
if (udp_sockets == 0)
/* No listeners configured */
return AFP_OK;
- if (u_name == NULL)
+ if (path == NULL)
return AFPERR_PARAM;
/* do some initialization on the fly the first time */
if (first_event) {
fce_initialize_history();
- first_event = FCE_FALSE;
+ first_event = 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]))
+ for (int i = 0; skip_files[i] != NULL; i++) {
+ if (strcmp(bname, skip_files[i]) == 0)
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 );
+ if (fce_handle_coalescation(event, path, type)) {
+ LOG(log_debug9, logtype_fce, "Coalesced fc event <%d> for <%s>", event, path);
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;
+ switch (event) {
+ case FCE_FILE_MODIFY:
+ save_close_event(path);
+ break;
+ default:
+ send_fce_event(path, event);
+ break;
}
- send_fce_event( full_path_buffer, mode );
-
return AFP_OK;
}
/* 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);
+ LOG(log_debug, logtype_fce, "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;
/*
* 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 )
-{
- int ret = AFP_OK;
-
- if (ofork == NULL)
- return AFPERR_PARAM;
-
- if (!(fce_ev_enabled & (1 << FCE_FILE_MODIFY)))
- return ret;
-
- ret = register_fce(of_name(ofork), 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)
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);
}
}
if (end_time && now >= end_time)
break;
- register_fce( path, 0, event_code );
+ fce_register(event_code, path, NULL, 0);
ev_cnt++;
#include <stdbool.h>
+#include <atalk/fce_api.h>
+
#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_COALESCE_DELETE (1 << 1)
#define FCE_COALESCE_ALL (FCE_COALESCE_CREATE | FCE_COALESCE_DELETE)
-struct udp_entry
-{
+struct udp_entry {
int sock;
char *addr;
char *port;
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_history {
+ fce_ev_t fce_h_event;
+ fce_obj_t fce_h_type;
+ char fce_h_path[MAXPATHLEN + 1];
+ struct timeval fce_h_tv;
};
struct fce_close_event {
#define PACKET_HDR_LEN (sizeof(struct fce_packet) - FCE_MAX_PATH_LEN)
-bool fce_handle_coalescation( char *path, int is_dir, int mode );
+bool fce_handle_coalescation(int event, const char *path, fce_obj_t type);
void fce_initialize_history();
// 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];
}
}
-bool fce_handle_coalescation( char *path, int is_dir, int mode )
+bool fce_handle_coalescation(int event, const char *path, fce_obj_t type)
{
/* These two are used to eval our next index in history */
/* the history is unsorted, speed should not be a problem, length is 10 */
return false;
/* After a file creation *ALWAYS* a file modification is produced */
- if ((mode == FCE_FILE_CREATE) && (coalesce & FCE_COALESCE_CREATE))
+ if ((event == FCE_FILE_CREATE) && (coalesce & FCE_COALESCE_CREATE))
return true;
/* get timestamp */
struct fce_history *fh = &fce_history_list[i];
/* Not inited ? */
- if (fh->tv.tv_sec == 0) {
+ if (fh->fce_h_tv.tv_sec == 0) {
/* we can use it for new elements */
oldest_entry = 0;
oldest_entry_idx = i;
}
/* Too old ? */
- if (get_ms_difftime( &fh->tv, &tv ) > MAX_COALESCE_TIME_MS) {
+ if (get_ms_difftime(&fh->fce_h_tv, &tv ) > MAX_COALESCE_TIME_MS) {
/* Invalidate entry */
- fh->tv.tv_sec = 0;
+ fh->fce_h_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)) {
+ if ((coalesce & FCE_COALESCE_CREATE) && (fh->fce_h_event == FCE_DIR_CREATE)) {
/* Parent dir ? */
- if (!strncmp(fh->path, path, strlen(fh->path)))
+ if (!strncmp(fh->fce_h_path, path, strlen(fh->fce_h_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)) {
+ && fh->fce_h_type
+ && (event == FCE_FILE_DELETE || event == FCE_DIR_DELETE)) {
/* Parent dir ? */
- if (!strncmp(fh->path, path, strlen(fh->path)))
+ if (!strncmp(fh->fce_h_path, path, strlen(fh->fce_h_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;
+ if (oldest_entry_idx == -1 || fh->fce_h_tv.tv_sec < oldest_entry) {
+ oldest_entry = fh->fce_h_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);
+ fce_history_list[oldest_entry_idx].fce_h_tv = tv;
+ fce_history_list[oldest_entry_idx].fce_h_event = event;
+ fce_history_list[oldest_entry_idx].fce_h_type = type;
+ strncpy(fce_history_list[oldest_entry_idx].fce_h_path, path, MAXPATHLEN);
/* we have to handle this event */
return false;
/* 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 (ad_finder) {
memcpy(data, ad_finder, ADEDLEN_FINDERI);
+ /* default type ? */
+ if (default_type(ad_finder))
+ chk_ext = 1;
}
else {
memcpy(data, ufinderi, ADEDLEN_FINDERI);
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;
}
createfile_iderr:
ad_flush(&ad);
ad_close(&ad, ADFLAGS_DF|ADFLAGS_HF );
- fce_register_new_file(s_path);
+ fce_register(FCE_FILE_CREATE, fullpathname(upath), NULL, fce_file);
sl_index_file(path);
+
+createfile_done:
curdir->d_offcnt++;
setvoltime(obj, vol );
uint16_t bitmap = f_bitmap;
uint32_t cdate,bdate;
u_char finder_buf[32];
- int symlinked = 0;
+ int symlinked = S_ISLNK(path->st.st_mode);
#ifdef DEBUG
LOG(log_debug9, logtype_afpd, "begin setfilparams:");
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 :
uint32_t sid, did;
uint16_t vid;
- uid_t uid;
- gid_t gid;
-
*rbuflen = 0;
ibuf += 2;
/* 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;
- }
+ become_root();
/*
* we need to exchange ACL entries as well
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);
- }
+ unbecome_root();
err = AFP_OK;
goto err_exchangefile;
#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 {
delcnid = cnid_get(vol->v_cdb, curdir->d_did, upath, strlen(upath));
if (delcnid != CNID_INVALID)
cnid_delete(vol->v_cdb, delcnid);
- fce_register_delete_dir(upath);
+ fce_register(FCE_DIR_DELETE, fullpathname(upath), NULL, fce_dir);
} else {
/* we have to cache this, the structs are lost in deletcurdir*/
/* but we need the positive returncode to send our event */
if ((dname = bstrcpy(curdir->d_u_name)) == NULL)
return AFPERR_MISC;
if ((rc = deletecurdir(vol)) == AFP_OK)
- fce_register_delete_dir(cfrombstr(dname));
+ fce_register(FCE_DIR_DELETE, fullpathname(cfrombstr(dname)), NULL, fce_dir);
bdestroy(dname);
}
} else if (of_findname(s_path)) {
rc = AFPERR_NOOBJ;
} else {
if ((rc = deletefile(vol, -1, upath, 1)) == AFP_OK) {
- fce_register_delete_file( s_path );
+ fce_register(FCE_FILE_DELETE, fullpathname(upath), NULL, fce_file);
if (vol->v_tm_used < s_path->st.st_size)
vol->v_tm_used = 0;
else
#include <atalk/logger.h>
#include <atalk/util.h>
#include <atalk/cnid.h>
+#include <atalk/bstrlib.h>
#include <atalk/bstradd.h>
#include <atalk/globals.h>
#include <atalk/netatalk_conf.h>
+++ /dev/null
-/*
- * $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 <sys/param.h>
-#include <string.h>
-#include <ctype.h>
-#include <pwd.h>
-
-#include <atalk/globals.h>
-
-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 */
afp_exit(EXITERR_SYS);
}
#endif
+
+ sv.sa_handler = SIG_IGN;
+ sigemptyset( &sv.sa_mask );
+ if (sigaction(SIGPIPE, &sv, NULL ) < 0 ) {
+ LOG(log_error, logtype_afpd, "main: sigaction: %s", strerror(errno) );
+ afp_exit(EXITERR_SYS);
+ }
sv.sa_handler = afp_goaway; /* handler for all sigs */
if (reloadconfig) {
nologin++;
- auth_unload();
+
fd_reset_listening_sockets(&obj);
LOG(log_info, logtype_afpd, "re-reading configuration file");
configfree(&obj, NULL);
+ afp_config_free(&obj);
+
+ if (afp_config_parse(&obj, "afpd") != 0)
+ afp_exit(EXITERR_CONF);
+
if (configinit(&obj) != 0) {
LOG(log_error, logtype_afpd, "config re-read: no servers configured");
afp_exit(EXITERR_CONF);
#include <atalk/afp.h>
#include <atalk/dsi.h>
#include <atalk/util.h>
+#include <atalk/unix.h>
#include <atalk/logger.h>
#include <atalk/globals.h>
unsigned int i;
int rc;
static int c;
- uid_t euid;
uint32_t maxmsgsize;
maxmsgsize = MIN(MAX(obj->dsi->attn_quantum, MAXMESGSIZE), MAXPATHLEN);
/* 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));
- }
+ become_root();
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);
- }
+ unbecome_root();
if (rc < 0) {
LOG(log_error, logtype_afpd, "Error deleting %s: %s", filename, strerror(rc));
/* 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);
+ struct dir *dir = dirlookup(ofork->of_vol, ofork->of_did);
+ bstring forkpath = bformat("%s/%s", bdata(dir->d_fullpath), of_name(ofork));
+ fce_register(FCE_FILE_MODIFY, bdata(forkpath), NULL, fce_file);
+ bdestroy(forkpath);
}
ad_unlock(ofork->of_ad, ofork->of_refnum, ofork->of_flags & AFPFORK_ERROR ? 0 : 1);
#include <atalk/logger.h>
#include <atalk/afp.h>
#include <atalk/compat.h>
+#include <atalk/unix.h>
#include "auth.h"
#include "volume.h"
return -1;
}
- if ( seteuid( getuid() ) != 0 ) {
- LOG(log_info, logtype_afpd, "seteuid(): %s",
- strerror(errno));
- return -1;
- }
+ become_root();
+
if ((retq = getfsquota(obj, vol, ufsq, uid, classq)) < 0) {
LOG(log_info, logtype_afpd, "getfsquota(%s, %s): %s",
vol->v_path, classq, strerror(errno));
}
- seteuid( uid );
+
+ unbecome_root();
+
if (retq < 1)
return retq;
#endif /* TRU64 */
#ifdef BSD4_4
- if ( seteuid( getuid() ) == 0 ) {
+ become_root();
if ( quotactl( vol->v_path, QCMD(Q_GETQUOTA,USRQUOTA),
uid, (char *)dq ) != 0 ) {
/* try group quotas */
if (obj->ngroups >= 1) {
if ( quotactl(vol->v_path, QCMD(Q_GETQUOTA, GRPQUOTA),
obj->groups[0], (char *) &dqg) != 0 ) {
- seteuid( uid );
+ unbecome_root();
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 );
+ unbecome_root();
}
#else /* BSD4_4 */
#include <atalk/util.h>
#include <atalk/globals.h>
#include <atalk/volume.h>
+#include <atalk/bstrlib.h>
#include "afp_config.h"
#include "auth.h"
return pwent;
/* if we have a NT domain name try with it */
- if (obj->options.ntdomain && obj->options.ntseparator) {
+ if (obj->options.addomain || (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;
+ bstring princ;
+ if (obj->options.addomain)
+ princ = bformat("%s@%s", name, obj->options.addomain);
+ else
+ princ = bformat("%s%s%s", obj->options.ntdomain, obj->options.ntseparator, name);
+ pwent = getpwnam(bdata(princ));
+ bdestroy(princ);
+
+ if (pwent) {
+ int len = strlen(pwent->pw_name);
+ if (len < MAXUSERLEN) {
+ strncpy(name,pwent->pw_name, MAXUSERLEN);
+ } else {
+ LOG(log_error, logtype_uams, "The name '%s' is longer than %d", pwent->pw_name, MAXUSERLEN);
}
+ return pwent;
}
}
#ifndef NO_REAL_USER_NAME
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 = getvolumes();
-
- 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
int vcnt;
size_t len;
- load_volumes(obj, closevol);
+ load_volumes(obj);
data = rbuf + 5;
for ( vcnt = 0, volume = getvolumes(); volume; volume = volume->v_next ) {
int len, ret;
size_t namelen;
uint16_t bitmap;
- char path[ MAXPATHLEN + 1];
char *vol_uname;
char *vol_mname;
char *volname_tmp;
if ((len + 1) & 1) /* pad to an even boundary */
ibuf++;
- load_volumes(obj, closevol);
+ load_volumes(obj);
for ( volume = getvolumes(); volume; volume = volume->v_next ) {
if ( strcasecmp_w( (ucs2_t*) volname, volume->v_name ) == 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;
goto openvol_err;
}
- if ((vol_uname = strrchr(path, '/')) == NULL)
- vol_uname = path;
- else if (*(vol_uname + 1) != '\0')
+ if ((vol_uname = strrchr(volume->v_path, '/')) == NULL)
+ vol_uname = volume->v_path;
+ else if (vol_uname[1] != '\0')
vol_uname++;
if ((dir = dir_new(vol_mname,
uint32_t *);
extern void setvoltime (AFPObj *, struct vol *);
extern int pollvoltime (AFPObj *);
-extern void vol_fce_tm_event(void);
/* FP functions */
int afp_openvol (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen);
else
setuplog("default:debug", "/dev/tty");
- if (load_volumes(&obj, NULL) != 0) {
+ if (load_volumes(&obj) != 0) {
dbd_log( LOGSTD, "Couldn't load volumes");
exit(EXIT_FAILURE);
}
if (afp_config_parse(&obj, "cnid_metad") != 0)
daemon_exit(1);
- if (load_volumes(&obj, NULL) != 0)
+ if (load_volumes(&obj) != 0)
daemon_exit(1);
(void)setlimits();
LOG(log_debug, logtype_cnid, "main: request for volume: %s", volpath);
- if (load_volumes(&obj, NULL) != 0) {
+ if (load_volumes(&obj) != 0) {
LOG(log_severe, logtype_cnid, "main: error reloading config");
goto loop_end;
}
EC_ZERO( afp_config_parse(&obj, "cnid_dbd") );
- EC_ZERO( load_volumes(&obj, NULL) );
+ EC_ZERO( load_volumes(&obj) );
EC_NULL( vol = getvolbypath(&obj, volpath) );
EC_ZERO( load_charset(vol) );
pack_setvol(vol);
netatalk_LDADD = \
$(top_builddir)/libatalk/libatalk.la
+netatalk_LDFLAGS =
+
if USE_BUILTIN_LIBEVENT
netatalk_CFLAGS += \
-I$(top_srcdir)/libevent/include \
netatalk_LDADD += \
$(top_builddir)/libevent/libevent.la
-endif
\ No newline at end of file
+else
+netatalk_CFLAGS += @LIBEVENT_CFLAGS@
+netatalk_LDFLAGS += @LIBEVENT_LDFLAGS@ -levent
+endif
kill_childs(SIGQUIT, &afpd_pid, &cnid_metad_pid, &dbus_pid, NULL);
}
+/* SIGQUIT callback */
+static void sighup_cb(evutil_socket_t fd, short what, void *arg)
+{
+ LOG(log_note, logtype_afpd, "Received SIGHUP, sending all processes signal to reload config");
+ kill_childs(SIGHUP, &afpd_pid, &cnid_metad_pid, NULL);
+}
+
/* SIGCHLD callback */
static void sigchld_cb(evutil_socket_t fd, short what, void *arg)
{
sigterm_ev = event_new(base, SIGTERM, EV_SIGNAL, sigterm_cb, NULL);
sigquit_ev = event_new(base, SIGQUIT, EV_SIGNAL | EV_PERSIST, sigquit_cb, NULL);
+ sigquit_ev = event_new(base, SIGHUP, EV_SIGNAL | EV_PERSIST, sighup_cb, NULL);
sigchld_ev = event_new(base, SIGCHLD, EV_SIGNAL | EV_PERSIST, sigchld_cb, NULL);
timer_ev = event_new(base, -1, EV_PERSIST, timer_cb, NULL);
sigdelset(&blocksigs, SIGTERM);
sigdelset(&blocksigs, SIGQUIT);
sigdelset(&blocksigs, SIGCHLD);
+ sigdelset(&blocksigs, SIGHUP);
sigprocmask(SIG_SETMASK, &blocksigs, NULL);
dbus_path = iniparser_getstring(obj.iniconfig, INISEC_GLOBAL, "dbus daemon path", "/bin/dbus-daemon");
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) {
uam_unregister(UAM_SERVER_LOGIN, "DHX2");
uam_unregister(UAM_SERVER_CHANGEPW, "DHX2");
+ LOG(log_debug, logtype_uams, "DHX2: uam_cleanup");
+
gcry_mpi_release(p);
gcry_mpi_release(g);
}
extern int flock (int, int);
#endif
-#ifndef HAVE_INET_ATON
-struct in_addr;
-extern int inet_aton(const char *, struct in_addr *);
-#endif
-
#ifndef HAVE_STRNLEN
extern size_t strnlen(const char *s, size_t n);
#endif
extern DSI *dsi_init(AFPObj *obj, const char *hostname, const char *address, const char *port);
extern void dsi_setstatus (DSI *, char *, const size_t);
extern int dsi_tcp_init(DSI *dsi, const char *hostname, const char *address, const char *port);
+extern void dsi_free(DSI *dsi);
/* in dsi_getsess.c */
extern int dsi_getsession (DSI *, server_child *, const int, afp_child_t **);
#define EC_INIT int ret = 0
#define EC_STATUS(a) ret = (a)
+#define EC_EXIT_STATUS(a) do { ret = (a); goto cleanup; } while (0)
#define EC_FAIL do { ret = -1; goto cleanup; } while (0)
#define EC_FAIL_LOG(...) \
do { \
#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
+#define FCE_FIRST_EVENT FCE_FILE_MODIFY /* keep in sync with last file event above */
+#define FCE_LAST_EVENT FCE_DIR_CREATE /* keep in sync with last file event above */
/* fce_packet.fce_magic */
#define FCE_PACKET_MAGIC "at_fcapi"
* Format is network byte order.
*/
#define FCE_PACKET_HEADER_SIZE 8+1+1+4+2
+
struct fce_packet
{
char magic[8];
char data[MAXPATHLEN];
};
+typedef uint32_t fce_ev_t;
+typedef enum { fce_file, fce_dir } fce_obj_t;
+
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_register(fce_ev_t event, const char *path, const char *oldpath, fce_obj_t type);
int fce_add_udp_socket(const char *target ); // IP or IP:Port
int fce_set_coalesce(const char *coalesce_opt ); // all|delete|create
-int fce_set_events(const char *events); /* fmod,fdel,ddel,fcre,dcre,tmsz (default is all except tmsz) */
+int fce_set_events(const char *events); /* fmod,fdel,ddel,fcre,dcre */
#define FCE_DEFAULT_PORT 12250
#define FCE_DEFAULT_PORT_STRING "12250"
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];
gid_t admingid;
int volnamelen;
/* default value for winbind authentication */
- char *ntdomain, *ntseparator;
+ char *ntdomain, *ntseparator, *addomain;
char *logconfig;
char *logfile;
char *mimicmodel;
extern int get_afp_errno (const int param);
extern void afp_options_init (struct afp_options *);
extern void afp_options_parse_cmdline(AFPObj *obj, int ac, char **av);
-extern void afp_options_free(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);
/* One function does the whole job */
extern int acl_ldap_readconfig(dictionary *iniconfig);
+extern void acl_ldap_freeconfig(void);
/* These are the prefvalues */
extern char *ldap_server;
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 */
+ int valid_save; /* copy of 'valid', used when resettting config */
};
struct pref_array {
logtype_afpd,
logtype_dsi,
logtype_uams,
+ logtype_fce,
+ logtype_ad,
logtype_sl,
logtype_end_of_list_marker /* don't put any logtypes after this */
};
#include <atalk/volume.h>
extern int afp_config_parse(AFPObj *obj, char *processname);
-
+extern void afp_config_free(AFPObj *obj);
extern int load_charset(struct vol *vol);
-extern int load_volumes(AFPObj *obj, void (*delvol_fn)(const AFPObj *obj, struct vol *));
+extern int load_volumes(AFPObj *obj);
extern void unload_volumes(AFPObj *obj);
extern struct vol *getvolumes(void);
extern struct vol *getvolbyvid(const uint16_t);
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
/* from charcnv.c */
extern int set_charset_name(charset_t, const char *);
+extern void free_charset_names(void);
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 **);
#include <config.h>
#endif
+#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
extern void randombytes(void *buf, int n);
extern int daemonize(int nochdir, int noclose);
extern int run_cmd(const char *cmd, char **cmd_argv);
+extern char *realpath_safe(const char *path);
+extern const char *basename_safe(const char *path);
/******************************************************************
* cnid.c
extern bstring rel_path_in_vol(const char *path, const char *volpath);
extern cnid_t cnid_for_path(struct _cnid_db *cdb, const char *volpath, const char *path, cnid_t *did);
+/******************************************************************
+ * cnid.c
+ *****************************************************************/
+
+extern void initline (int, char *);
+extern int parseline (int, char *);
+
#endif /* _ATALK_UTIL_H */
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;
# 3.0.0-beta2 1:0:0
# 3.0 1:0:0
# 3.0.1 2:0:0
+# 3.0.2 3:0:1
SUBDIRS = acl adouble bstring compat cnid dsi iniparser talloc tdb util unicode vfs
libatalk_la_SOURCES = dummy.c
+libatalk_la_CFLAGS = \
+ @PTHREAD_CFLAGS@
+
libatalk_la_LIBADD = \
- @WRAP_LIBS@ @ACL_LIBS@ \
+ @WRAP_LIBS@ @ACL_LIBS@ @PTHREAD_LIBS@ \
acl/libacl.la \
adouble/libadouble.la \
bstring/libbstring.la \
EXTRA_DIST = \
libatalk-3.0beta1.abi \
libatalk-3.0beta2.abi \
+ libatalk-3.0.1.abi \
libatalk-3.0.abi
#include <sys/time.h>
#include <string.h>
#include <errno.h>
+#include <ctype.h>
#define LDAP_DEPRECATED 1
#include <ldap.h>
int ldap_uuid_encoding;
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_uuid_string,"ldap uuid string", 0, 0, 0},
- {&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},
- {&ldap_uuid_encoding,"ldap uuid encoding", 1, 1, 0},
- {NULL, NULL, 0, 0, -1}
+ /* pointer to pref, prefname, strorint, intfromarray, valid, valid_save */
+ {&ldap_server, "ldap server", 0, 0, -1, -1},
+ {&ldap_auth_method, "ldap auth method", 1, 1, -1, -1},
+ {&ldap_auth_dn, "ldap auth dn", 0, 0, 0, 0},
+ {&ldap_auth_pw, "ldap auth pw", 0, 0, 0, 0},
+ {&ldap_userbase, "ldap userbase", 0, 0, -1, -1},
+ {&ldap_userscope, "ldap userscope", 1 ,1, -1, -1},
+ {&ldap_groupbase, "ldap groupbase", 0, 0, -1, -1},
+ {&ldap_groupscope, "ldap groupscope", 1 ,1, -1, -1},
+ {&ldap_uuid_attr, "ldap uuid attr", 0, 0, -1, -1},
+ {&ldap_uuid_string, "ldap uuid string", 0, 0, 0, 0},
+ {&ldap_name_attr, "ldap name attr", 0, 0, -1, -1},
+ {&ldap_group_attr, "ldap group attr", 0, 0, -1, -1},
+ {&ldap_uid_attr, "ldap uid attr", 0, 0, 0, 0},
+ {&ldap_uuid_encoding, "ldap uuid encoding", 1, 1, 0, 0},
+ {NULL, NULL, 0, 0, 0, 0}
};
struct pref_array prefs_array[] = {
#include <atalk/logger.h>
#include <atalk/iniparser.h>
+void acl_ldap_freeconfig(void)
+{
+ for (int i = 0; ldap_prefs[i].name != NULL; i++) {
+ if (ldap_prefs[i].intfromarray == 0 && ldap_prefs[i].strorint == 0) {
+ free(*((char **)(ldap_prefs[i].pref)));
+ *((char **)(ldap_prefs[i].pref)) = NULL;
+ }
+ ldap_prefs[i].valid = ldap_prefs[i].valid_save;
+ }
+}
+
int acl_ldap_readconfig(dictionary *iniconfig)
{
int i, j;
uint32_t ctime, mtime, afpinfo = 0;
char *emptyad;
- LOG(log_debug, logtype_default,"ad_conv_v22ea_hf(\"%s\"): BEGIN", fullpathname(path));
+ LOG(log_debug, logtype_ad,"ad_conv_v22ea_hf(\"%s\"): BEGIN", fullpathname(path));
+
+ switch (S_IFMT & sp->st_mode) {
+ case S_IFREG:
+ break;
+ default:
+ return 0;
+ }
ad_init(&adea, vol);
ad_init_old(&adv2, AD_VERSION2, adea.ad_options);
+
adflags = S_ISDIR(sp->st_mode) ? ADFLAGS_DIR : 0;
/* Open and lock adouble:v2 file */
goto copy;
}
- LOG(log_debug, logtype_default,"ad_conv_v22ea_hf(\"%s\"): default adouble", fullpathname(path), ret);
+ LOG(log_debug, logtype_ad,"ad_conv_v22ea_hf(\"%s\"): default adouble", fullpathname(path), ret);
goto EC_CLEANUP;
copy:
/* Create a adouble:ea meta EA */
- LOG(log_debug, logtype_default,"ad_conv_v22ea_hf(\"%s\"): copying adouble", fullpathname(path), ret);
+ LOG(log_debug, logtype_ad,"ad_conv_v22ea_hf(\"%s\"): copying adouble", fullpathname(path), ret);
EC_ZERO_LOGSTR( ad_open(&adea, path, adflags | ADFLAGS_HF | ADFLAGS_RDWR | ADFLAGS_CREATE),
"ad_conv_v22ea_hf(\"%s\"): error creating metadata EA: %s",
fullpathname(path), strerror(errno));
EC_CLEANUP:
EC_ZERO_LOG( ad_close(&adv2, ADFLAGS_HF | ADFLAGS_SETSHRMD) );
EC_ZERO_LOG( ad_close(&adea, ADFLAGS_HF | ADFLAGS_SETSHRMD) );
- LOG(log_debug, logtype_default,"ad_conv_v22ea_hf(\"%s\"): END: %d", fullpathname(path), ret);
+ LOG(log_debug, logtype_ad,"ad_conv_v22ea_hf(\"%s\"): END: %d", fullpathname(path), ret);
EC_EXIT;
}
struct adouble adv2;
struct adouble adea;
- LOG(log_debug, logtype_default,"ad_conv_v22ea_rf(\"%s\"): BEGIN", fullpathname(path));
+ LOG(log_debug, logtype_ad,"ad_conv_v22ea_rf(\"%s\"): BEGIN", fullpathname(path));
+
+ switch (S_IFMT & sp->st_mode) {
+ case S_IFREG:
+ break;
+ default:
+ return 0;
+ }
if (S_ISDIR(sp->st_mode))
return 0;
EC_CLEANUP:
EC_ZERO_LOG( ad_close(&adv2, ADFLAGS_HF | ADFLAGS_RF) );
EC_ZERO_LOG( ad_close(&adea, ADFLAGS_HF | ADFLAGS_RF) );
- LOG(log_debug, logtype_default,"ad_conv_v22ea_rf(\"%s\"): END: %d", fullpathname(path), ret);
+ LOG(log_debug, logtype_ad,"ad_conv_v22ea_rf(\"%s\"): END: %d", fullpathname(path), ret);
EC_EXIT;
}
EC_ZERO( ad_conv_v22ea_rf(path, sp, vol) );
EC_NULL( adpath = ad_path(path, adflags) );
- LOG(log_debug, logtype_default,"ad_conv_v22ea_hf(\"%s\"): deleting adouble:v2 file: \"%s\"",
+ LOG(log_debug, logtype_ad,"ad_conv_v22ea_hf(\"%s\"): deleting adouble:v2 file: \"%s\"",
path, fullpathname(adpath));
unlink(adpath);
int adflags = S_ISDIR(sp->st_mode) ? ADFLAGS_DIR : 0;
bstring newpath = NULL;
- LOG(log_debug, logtype_default,"ad_conv_dehex(\"%s\"): BEGIN", fullpathname(path));
+ LOG(log_debug, logtype_ad,"ad_conv_dehex(\"%s\"): BEGIN", fullpathname(path));
*newpathp = NULL;
EC_INIT;
const char *p;
- LOG(log_debug, logtype_default,"ad_convert(\"%s\"): BEGIN", fullpathname(path));
+ LOG(log_debug, logtype_ad,"ad_convert(\"%s\"): BEGIN", fullpathname(path));
if (newpath)
*newpath = NULL;
}
EC_CLEANUP:
- LOG(log_debug, logtype_default,"ad_convert(\"%s\"): END: %d", fullpathname(path), ret);
+ LOG(log_debug, logtype_ad,"ad_convert(\"%s\"): END: %d", fullpathname(path), ret);
EC_EXIT;
}
char *buf, *nentp;
int len;
- LOG(log_debug, logtype_default, "ad_rebuild_adouble_header_v2");
+ LOG(log_debug, logtype_ad, "ad_rebuild_adouble_header_v2");
buf = ad->ad_data;
char *buf, *nentp;
int len;
- LOG(log_debug, logtype_default, "ad_rebuild_adouble_header_ea");
+ LOG(log_debug, logtype_ad, "ad_rebuild_adouble_header_ea");
buf = ad->ad_data;
char *buf;
int len;
- LOG(log_debug, logtype_default, "ad_rebuild_adouble_header_osx");
+ LOG(log_debug, logtype_ad, "ad_rebuild_adouble_header_osx");
buf = &adbuf[0];
memcpy(buf, &temp, sizeof( temp ));
buf += sizeof( temp );
- memset(buf, 0, sizeof(ad->ad_filler));
+ memcpy(buf, "Netatalk ", 16);
buf += sizeof( ad->ad_filler );
nent = htons(ADEID_NUM_OSX);
int len;
int cwd = -1;
- LOG(log_debug, logtype_default, "ad_flush_hf(%s)", adflags2logstr(ad->ad_adflags));
+ LOG(log_debug, logtype_ad, "ad_flush_hf(%s)", adflags2logstr(ad->ad_adflags));
struct ad_fd *adf;
adf = &ad->ad_data_fork;
break;
default:
- LOG(log_error, logtype_afpd, "ad_flush: unexpected adouble version");
+ LOG(log_error, logtype_ad, "ad_flush: unexpected adouble version");
return -1;
}
}
break;
default:
- LOG(log_error, logtype_afpd, "ad_flush: unexpected adouble version");
+ LOG(log_error, logtype_ad, "ad_flush: unexpected adouble version");
return -1;
}
}
if (ad->ad_vers != AD_VERSION_EA)
return 0;
- LOG(log_debug, logtype_default, "ad_flush_rf(%s)", adflags2logstr(ad->ad_adflags));
+ LOG(log_debug, logtype_ad, "ad_flush_rf(%s)", adflags2logstr(ad->ad_adflags));
if ((ad->ad_rfp->adf_flags & O_RDWR)) {
if (ad_getentryoff(ad, ADEID_RFORK)) {
{
EC_INIT;
- LOG(log_debug, logtype_default, "ad_flush(%s)", adflags2logstr(ad->ad_adflags));
+ LOG(log_debug, logtype_ad, "ad_flush(%s)", adflags2logstr(ad->ad_adflags));
if (AD_META_OPEN(ad)) {
EC_ZERO( ad_flush_hf(ad) );
return err;
- LOG(log_debug, logtype_default,
+ LOG(log_debug, logtype_ad,
"ad_close(%s): BEGIN: {d: %d, m: %d, r: %d} "
"[dfd: %d (ref: %d), mfd: %d (ref: %d), rfd: %d (ref: %d)]",
adflags2logstr(adflags),
if ((adflags & ADFLAGS_DF) && (ad_data_fileno(ad) >= 0 || ad_data_fileno(ad) == AD_SYMLINK)) {
if (ad->ad_data_refcount)
- ad->ad_data_refcount--;
+ if (--ad->ad_data_refcount == 0)
+ adf_lock_free(&ad->ad_data_fork);
if (--ad->ad_data_fork.adf_refcount == 0) {
if (ad_data_closefd(ad) < 0)
err = -1;
- adf_lock_free(&ad->ad_data_fork);
}
}
if (close( ad_meta_fileno(ad)) < 0)
err = -1;
ad_meta_fileno(ad) = -1;
- if (ad->ad_vers == AD_VERSION2)
- adf_lock_free(ad->ad_mdp);
}
}
if (adflags & ADFLAGS_RF) {
if (ad->ad_reso_refcount)
- ad->ad_reso_refcount--;
+ if (--ad->ad_reso_refcount == 0)
+ adf_lock_free(ad->ad_rfp);
if (ad->ad_vers == AD_VERSION_EA) {
if ((ad_reso_fileno(ad) != -1)
&& !(--ad->ad_rfp->adf_refcount)) {
err = -1;
ad->ad_rlen = 0;
ad_reso_fileno(ad) = -1;
- adf_lock_free(ad->ad_rfp);
}
}
}
- LOG(log_debug, logtype_default,
+ LOG(log_debug, logtype_ad,
"ad_close(%s): END: %d {d: %d, m: %d, r: %d} "
"[dfd: %d (ref: %d), mfd: %d (ref: %d), rfd: %d (ref: %d)]",
adflags2logstr(adflags), err,
{
EC_INIT;
- LOG(log_debug, logtype_default, "set_lock(fd: %d, %s, %s, off: %jd (%s), len: %jd): BEGIN",
+ LOG(log_debug, logtype_ad, "set_lock(fd: %d, %s, %s, off: %jd (%s), len: %jd): BEGIN",
fd, cmd == F_SETLK ? "F_SETLK" : "F_GETLK",
lock->l_type == F_RDLCK ? "F_RDLCK" : lock->l_type == F_WRLCK ? "F_WRLCK" : "F_UNLCK",
(intmax_t)lock->l_start,
int type;
int ret = 0, fcntl_lock_err = 0;
- LOG(log_debug, logtype_default, "ad_lock(%s, %s, off: %jd (%s), len: %jd): BEGIN",
+ LOG(log_debug, logtype_ad, "ad_lock(%s, %s, off: %jd (%s), len: %jd): BEGIN",
eid == ADEID_DFORK ? "data" : "reso",
locktypetostr(locktype),
(intmax_t)off,
set_lock(adf->adf_fd, F_SETLK, &lock);
}
}
- LOG(log_debug, logtype_default, "ad_lock: END: %d", ret);
+ LOG(log_debug, logtype_ad, "ad_lock: END: %d", ret);
return ret;
}
int err;
int type;
- LOG(log_debug, logtype_default, "ad_tmplock(%s, %s, off: %jd (%s), len: %jd): BEGIN",
+ LOG(log_debug, logtype_ad, "ad_tmplock(%s, %s, off: %jd (%s), len: %jd): BEGIN",
eid == ADEID_DFORK ? "data" : "reso",
locktypetostr(locktype),
(intmax_t)off,
adf_relockrange(adf, adf->adf_fd, lock.l_start, len);
exit:
- LOG(log_debug, logtype_default, "ad_tmplock: END: %d", err);
+ LOG(log_debug, logtype_ad, "ad_tmplock: END: %d", err);
return err;
}
/* --------------------- */
void ad_unlock(struct adouble *ad, const int fork, int unlckbrl)
{
- LOG(log_debug, logtype_default, "ad_unlock(unlckbrl: %d): BEGIN", unlckbrl);
+ LOG(log_debug, logtype_ad, "ad_unlock(unlckbrl: %d): BEGIN", unlckbrl);
if (ad_data_fileno(ad) != -1) {
adf_unlock(ad, &ad->ad_data_fork, fork, unlckbrl);
adf_unlock(ad, &ad->ad_resource_fork, fork, unlckbrl);
}
- LOG(log_debug, logtype_default, "ad_unlock: END");
+ LOG(log_debug, logtype_ad, "ad_unlock: END");
}
/*!
int ret = 0;
off_t lock_offset;
- LOG(log_debug, logtype_default, "ad_testlock(%s, off: %jd (%s): BEGIN",
+ LOG(log_debug, logtype_ad, "ad_testlock(%s, off: %jd (%s): BEGIN",
eid == ADEID_DFORK ? "data" : "reso",
(intmax_t)off,
shmdstrfromoff(off));
ret = testlock(&ad->ad_data_fork, lock_offset, 1);
- LOG(log_debug, logtype_default, "ad_testlock: END: %d", ret);
+ LOG(log_debug, logtype_ad, "ad_testlock: END: %d", ret);
return ret;
}
uint16_t ashort;
struct stat st;
- LOG(log_debug, logtype_default, "new_ad_header(\"%s\")", path);
+ LOG(log_debug, logtype_ad, "new_ad_header(\"%s\")", path);
if (ad->ad_magic == AD_MAGIC) {
- LOG(log_debug, logtype_default, "new_ad_header(\"%s\"): already initialized", path);
+ LOG(log_debug, logtype_ad, "new_ad_header(\"%s\"): already initialized", path);
return 0;
}
ad->ad_eid[ eid ].ade_len = len;
} else if (!warning) {
warning = 1;
- LOG(log_warning, logtype_default, "parse_entries: bogus eid: %d", eid);
+ LOG(log_warning, logtype_ad, "parse_entries: bogus eid: %d", eid);
}
}
}
ad->ad_version = ntohl( ad->ad_version );
if ((ad->ad_magic != AD_MAGIC) || (ad->ad_version != AD_VERSION2)) {
- LOG(log_error, logtype_default, "ad_open: can't parse AppleDouble header.");
+ LOG(log_error, logtype_ad, "ad_open: can't parse AppleDouble header.");
errno = EIO;
return -1;
}
buf += AD_HEADER_LEN;
if (len > header_len - AD_HEADER_LEN) {
- LOG(log_error, logtype_default, "ad_header_read: can't read entry info.");
+ LOG(log_error, logtype_ad, "ad_header_read: can't read entry info.");
errno = EIO;
return -1;
}
if (!ad_getentryoff(ad, ADEID_RFORK)
|| (ad_getentryoff(ad, ADEID_RFORK) > sizeof(ad->ad_data))
) {
- LOG(log_error, logtype_default, "ad_header_read: problem with rfork entry offset.");
+ LOG(log_error, logtype_ad, "ad_header_read: problem with rfork entry offset.");
errno = EIO;
return -1;
}
if (ad_getentryoff(ad, ADEID_RFORK) > header_len) {
- LOG(log_error, logtype_default, "ad_header_read: can't read in entries.");
+ LOG(log_error, logtype_ad, "ad_header_read: can't read in entries.");
errno = EIO;
return -1;
}
char *buf = &adosx.ad_data[0];
ssize_t header_len;
- LOG(log_debug, logtype_afpd, "ad_valid_header_osx(\"%s\"): BEGIN", fullpathname(path));
+ LOG(log_debug, logtype_ad, "ad_valid_header_osx(\"%s\"): BEGIN", fullpathname(path));
EC_NEG1( fd = open(path, O_RDONLY) );
adosx.ad_version = ntohl(adosx.ad_version);
if ((adosx.ad_magic != AD_MAGIC) || (adosx.ad_version != AD_VERSION2)) {
- LOG(log_error, logtype_afpd, "ad_valid_header_osx: not an adouble:ox file");
+ LOG(log_warning, logtype_ad, "ad_valid_header_osx: not an adouble:osx file");
EC_FAIL;
}
+ if (strncmp(buf + ADEDOFF_FILLER, "Mac OS X", strlen("Mac OS X")) == 0)
+ /*
+ * It's a split fork created by OS X, it's not our "own" ._ file
+ * and thus not a valid header in this context.
+ * We allow enumeration and access.
+ */
+ EC_FAIL;
+
EC_CLEANUP:
- LOG(log_debug, logtype_afpd, "ad_valid_header_osx(\"%s\"): END: %d", fullpathname(path), ret);
+ LOG(log_debug, logtype_ad, "ad_valid_header_osx(\"%s\"): END: %d", fullpathname(path), ret);
if (fd != -1)
close(fd);
if (ret != 0)
adosx.ad_version = ntohl(adosx.ad_version);
if ((adosx.ad_magic != AD_MAGIC) || (adosx.ad_version != AD_VERSION2)) {
- LOG(log_error, logtype_afpd, "ad_header_read_osx: can't parse AppleDouble header");
+ LOG(log_error, logtype_ad, "ad_header_read_osx: can't parse AppleDouble header");
errno = EIO;
return -1;
}
buf += AD_HEADER_LEN;
if (len > header_len - AD_HEADER_LEN) {
- LOG(log_error, logtype_afpd, "ad_header_read_osx: can't read entry info.");
+ LOG(log_error, logtype_ad, "ad_header_read_osx: can't read entry info.");
errno = EIO;
return -1;
}
|| ad_getentryoff(&adosx, ADEID_RFORK) > sizeof(ad->ad_data)
|| ad_getentryoff(&adosx, ADEID_RFORK) > header_len
) {
- LOG(log_error, logtype_afpd, "ad_header_read_osx: problem with rfork entry offset.");
+ LOG(log_error, logtype_ad, "ad_header_read_osx: problem with rfork entry offset.");
errno = EIO;
return -1;
}
else
header_len = sys_lgetxattr(path, AD_EA_META, ad->ad_data, AD_DATASZ_EA);
if (header_len < 1) {
- LOG(log_debug, logtype_default, "ad_header_read_ea: %s", strerror(errno));
+ LOG(log_debug, logtype_ad, "ad_header_read_ea: %s", strerror(errno));
return -1;
}
if (header_len < AD_HEADER_LEN) {
- LOG(log_error, logtype_default, "ad_header_read_ea: bogus AppleDouble header.");
+ LOG(log_error, logtype_ad, "ad_header_read_ea: bogus AppleDouble header.");
errno = EIO;
return -1;
}
ad->ad_version = ntohl( ad->ad_version );
if ((ad->ad_magic != AD_MAGIC) || (ad->ad_version != AD_VERSION2)) {
- LOG(log_error, logtype_default, "ad_header_read_ea: wrong magic or version");
+ LOG(log_error, logtype_ad, "ad_header_read_ea: wrong magic or version");
errno = EIO;
return -1;
}
if (len + AD_HEADER_LEN > sizeof(ad->ad_data))
len = sizeof(ad->ad_data) - AD_HEADER_LEN;
if (len > header_len - AD_HEADER_LEN) {
- LOG(log_error, logtype_default, "ad_header_read_ea: can't read entry info.");
+ LOG(log_error, logtype_ad, "ad_header_read_ea: can't read entry info.");
errno = EIO;
return -1;
}
int st_invalid = -1;
ssize_t lsz;
- LOG(log_debug, logtype_default,
+ LOG(log_debug, logtype_ad,
"ad_open_df(\"%s\", %s): BEGIN [dfd: %d (ref: %d), mfd: %d (ref: %d), rfd: %d (ref: %d)]",
fullpathname(path), adflags2logstr(adflags),
ad_data_fileno(ad), ad->ad_data_fork.adf_refcount,
ad->ad_data_fork.adf_refcount++;
EC_CLEANUP:
- LOG(log_debug, logtype_default,
+ LOG(log_debug, logtype_ad,
"ad_open_df(\"%s\", %s): END: %d [dfd: %d (ref: %d), mfd: %d (ref: %d), rfd: %d (ref: %d)]",
fullpathname(path), adflags2logstr(adflags), ret,
ad_data_fileno(ad), ad->ad_data_fork.adf_refcount,
mode_t admode;
int st_invalid = -1;
- LOG(log_debug, logtype_default,
+ LOG(log_debug, logtype_ad,
"ad_open_hf_v2(\"%s\", %s): BEGIN [dfd: %d (ref: %d), mfd: %d (ref: %d), rfd: %d (ref: %d)]",
fullpathname(path), adflags2logstr(adflags),
ad_data_fileno(ad), ad->ad_data_fork.adf_refcount,
ad_p = ad->ad_ops->ad_path(path, adflags);
oflags = O_NOFOLLOW | ad2openflags(ad, ADFLAGS_HF, adflags);
- LOG(log_debug, logtype_default,"ad_open_hf_v2(\"%s\"): open flags: %s",
+ LOG(log_debug, logtype_ad,"ad_open_hf_v2(\"%s\"): open flags: %s",
fullpathname(path), openflags2logstr(oflags));
nocreatflags = oflags & ~(O_CREAT | O_EXCL);
/*
* We're expecting to create a new adouble header file here
*/
- LOG(log_debug, logtype_default, "ad_open(\"%s\"): creating adouble file",
+ LOG(log_debug, logtype_ad, "ad_open(\"%s\"): creating adouble file",
fullpathname(path));
admode = mode;
errno = 0;
ad_meta_fileno(ad) = -1;
ad->ad_mdp->adf_refcount = 0;
}
- LOG(log_debug, logtype_default,
+ LOG(log_debug, logtype_ad,
"ad_open_hf_v2(\"%s\", %s): END: %d [dfd: %d (ref: %d), mfd: %d (ref: %d), rfd: %d (ref: %d)]",
fullpathname(path), adflags2logstr(adflags), ret,
ad_data_fileno(ad), ad->ad_data_fork.adf_refcount,
int oflags;
int opened = 0;
- LOG(log_debug, logtype_default,
+ LOG(log_debug, logtype_ad,
"ad_open_hf_ea(\"%s\", %s): BEGIN [dfd: %d (ref: %d), mfd: %d (ref: %d), rfd: %d (ref: %d)]",
fullpathname(path), adflags2logstr(adflags),
ad_data_fileno(ad), ad->ad_data_fork.adf_refcount,
if ((oflags & O_RDWR) &&
/* and it was already denied: */
(ad->ad_mdp->adf_flags & O_RDONLY)) {
- LOG(log_error, logtype_default, "ad_open_hf_ea(%s): rw request for ro file: %s",
+ LOG(log_error, logtype_ad, "ad_open_hf_ea(%s): rw request for ro file: %s",
fullpathname(path), strerror(errno));
errno = EACCES;
EC_FAIL;
if (adflags & ADFLAGS_DIR)
/* For directories we open the directory RDONYL so we can later fchdir() */
oflags = (oflags & ~O_RDWR) | O_RDONLY;
- LOG(log_debug, logtype_default, "ad_open_hf_ea(\"%s\"): opening base file for meta adouble EA", path);
+ LOG(log_debug, logtype_ad, "ad_open_hf_ea(\"%s\"): opening base file for meta adouble EA", path);
EC_NEG1(ad_meta_fileno(ad) = open(path, oflags));
opened = 1;
ad->ad_mdp->adf_flags = oflags;
/* Read the adouble header in and parse it.*/
if (ad->ad_ops->ad_header_read(path, ad, NULL) != 0) {
if (!(adflags & ADFLAGS_CREATE)) {
- LOG(log_debug, logtype_default, "ad_open_hf_ea(\"%s\"): can't read metadata EA", path);
+ LOG(log_debug, logtype_ad, "ad_open_hf_ea(\"%s\"): can't read metadata EA", path);
errno = ENOENT;
EC_FAIL;
}
- LOG(log_debug, logtype_default, "ad_open_hf_ea(\"%s\"): creating metadata EA", path);
+ LOG(log_debug, logtype_ad, "ad_open_hf_ea(\"%s\"): creating metadata EA", path);
/* It doesnt exist, EPERM or another error */
if (!(errno == ENOATTR || errno == ENOENT)) {
- LOG(log_error, logtype_default, "ad_open_hf_ea: unexpected: %s", strerror(errno));
+ LOG(log_error, logtype_ad, "ad_open_hf_ea: unexpected: %s", strerror(errno));
EC_FAIL;
}
EC_NEG1_LOG(new_ad_header(ad, path, NULL, adflags));
ad->ad_mdp->adf_flags |= O_CREAT; /* mark as just created */
ad_flush(ad);
- LOG(log_debug, logtype_default, "ad_open_hf_ea(\"%s\"): created metadata EA", path);
+ LOG(log_debug, logtype_ad, "ad_open_hf_ea(\"%s\"): created metadata EA", path);
}
if (ad_meta_fileno(ad) != -1)
ad_meta_fileno(ad) = -1;
ad->ad_mdp->adf_refcount = 0;
}
- LOG(log_debug, logtype_default,
+ LOG(log_debug, logtype_ad,
"ad_open_hf_ea(\"%s\", %s): END: %d [dfd: %d (ref: %d), mfd: %d (ref: %d), rfd: %d (ref: %d)]",
fullpathname(path), adflags2logstr(adflags), ret,
ad_data_fileno(ad), ad->ad_data_fork.adf_refcount,
goto EC_CLEANUP;
}
- LOG(log_debug, logtype_default, "ad_reso_size(\"%s\"): BEGIN", path);
+ LOG(log_debug, logtype_ad, "ad_reso_size(\"%s\"): BEGIN", path);
#ifdef HAVE_EAFD
ssize_t easz;
ad->ad_rlen = 0;
#endif
- LOG(log_debug, logtype_default, "ad_reso_size(\"%s\"): size: %zd", path, ad->ad_rlen);
+ LOG(log_debug, logtype_ad, "ad_reso_size(\"%s\"): size: %zd", path, ad->ad_rlen);
EC_CLEANUP:
if (ret != 0)
struct stat st;
#endif
- LOG(log_debug, logtype_default, "ad_open_rf(\"%s\"): BEGIN", fullpathname(path));
+ LOG(log_debug, logtype_ad, "ad_open_rf(\"%s\"): BEGIN", fullpathname(path));
oflags = O_NOFOLLOW | (ad2openflags(ad, ADFLAGS_RF, adflags) & ~O_CREAT);
EC_FAIL;
oflags |= O_CREAT;
EC_NEG1_LOG( ad_reso_fileno(ad) = open(rfpath, oflags, mode) );
- LOG(log_debug, logtype_default, "ad_open_rf(\"%s\"): created adouble rfork: \"%s\"",
+ LOG(log_debug, logtype_ad, "ad_open_rf(\"%s\"): created adouble rfork: \"%s\"",
path, rfpath);
}
#endif
EC_ZERO_LOG( fstat(ad_reso_fileno(ad), &st) );
if (ad->ad_rfp->adf_flags & O_CREAT) {
/* This is a new adouble header file, create it */
- LOG(log_debug, logtype_default, "ad_open_rf(\"%s\"): created adouble rfork, initializing: \"%s\"",
+ LOG(log_debug, logtype_ad, "ad_open_rf(\"%s\"): created adouble rfork, initializing: \"%s\"",
path, rfpath);
EC_NEG1_LOG( new_ad_header(ad, path, NULL, adflags) );
- LOG(log_debug, logtype_default, "ad_open_rf(\"%s\"): created adouble rfork, flushing: \"%s\"",
+ LOG(log_debug, logtype_ad, "ad_open_rf(\"%s\"): created adouble rfork, flushing: \"%s\"",
path, rfpath);
ad_flush(ad);
} else {
/* Read the adouble header */
- LOG(log_debug, logtype_default, "ad_open_rf(\"%s\"): reading adouble rfork: \"%s\"",
+ LOG(log_debug, logtype_ad, "ad_open_rf(\"%s\"): reading adouble rfork: \"%s\"",
path, rfpath);
EC_NEG1_LOG( ad_header_read_osx(NULL, ad, &st) );
}
ad->ad_rlen = 0;
}
- LOG(log_debug, logtype_default, "ad_open_rf(\"%s\"): END: %d", fullpathname(path), ret);
+ LOG(log_debug, logtype_ad, "ad_open_rf(\"%s\"): END: %d", fullpathname(path), ret);
EC_EXIT;
}
int st_invalid;
struct stat stbuf;
- LOG(log_debug, logtype_default, "ad_mkdir(\"%s\", %04o) {cwd: \"%s\"}",
+ LOG(log_debug, logtype_ad, "ad_mkdir(\"%s\", %04o) {cwd: \"%s\"}",
path, mode, getcwdpath());
st_invalid = ad_mode_st(path, &mode, &stbuf);
va_list args;
mode_t mode = 0;
- LOG(log_debug, logtype_default,
+ LOG(log_debug, logtype_ad,
"ad_open(\"%s\", %s): BEGIN {d: %d, m: %d, r: %d}"
"[dfd: %d (ref: %d), mfd: %d (ref: %d), rfd: %d (ref: %d)]",
fullpathname(path), adflags2logstr(adflags),
}
EC_CLEANUP:
- LOG(log_debug, logtype_default,
+ LOG(log_debug, logtype_ad,
"ad_open(\"%s\"): END: %d {d: %d, m: %d, r: %d}"
"[dfd: %d (ref: %d), mfd: %d (ref: %d), rfd: %d (ref: %d)]",
fullpathname(path), ret,
*/
int ad_metadata(const char *name, int flags, struct adouble *adp)
{
- uid_t uid;
int ret, err, oflags;
/* Sanitize flags */
oflags = (flags & (ADFLAGS_CHECK_OF | ADFLAGS_DIR)) | ADFLAGS_HF | ADFLAGS_RDONLY;
if ((ret = ad_open(adp, name, oflags)) < 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 */
+ become_root();
ret = ad_open(adp, name, oflags);
+ unbecome_root();
err = errno;
- if ( seteuid(uid) < 0) {
- LOG(log_error, logtype_default, "ad_metadata: can't seteuid back");
- exit(EXITERR_SYS);
- }
errno = err;
}
if (dirfd != -1) {
if (fchdir(cwdfd) != 0) {
- LOG(log_error, logtype_afpd, "ad_openat: cant chdir back, exiting");
+ LOG(log_error, logtype_ad, "ad_openat: cant chdir back, exiting");
exit(EXITERR_SYS);
}
}
return -1;
}
- LOG(log_debug, logtype_default, "ad_write: off: %ju, size: %zu, eabuflen: %zu",
+ LOG(log_debug, logtype_ad, "ad_write: off: %ju, size: %zu, eabuflen: %zu",
(uintmax_t)off, buflen, ad->ad_rlen);
if ( eid == ADEID_DFORK ) {
if (ret == 0)
ad->ad_rlen = size;
else
- LOG(log_error, logtype_default, "ad_rtruncate(\"%s\"): %s",
+ LOG(log_error, logtype_ad, "ad_rtruncate(\"%s\"): %s",
fullpathname(ad->ad_name), strerror(errno));
EC_EXIT;
}
int ad_dtruncate(struct adouble *ad, const off_t size)
{
if (sys_ftruncate(ad_data_fileno(ad), size) < 0) {
- LOG(log_error, logtype_default, "sys_ftruncate(fd: %d): %s",
+ LOG(log_error, logtype_ad, "sys_ftruncate(fd: %d): %s",
ad_data_fileno(ad), strerror(errno));
return -1;
}
+++ /dev/null
-/*
- * $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 <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#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__ ) */
/* 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);
*childp = NULL;
return 0;
dsi->end = dsi->buffer + (dsi->dsireadbuf * dsi->server_quantum);
}
+/*!
+ * Free any allocated ressources of the master afpd DSI objects and close server socket
+ */
+void dsi_free(DSI *dsi)
+{
+ close(dsi->serversock);
+ dsi->serversock = -1;
+
+ free(dsi->commands);
+ dsi->commands = NULL;
+
+ free(dsi->buffer);
+ dsi->buffer = NULL;
+
+ free(dsi->bonjourname);
+ dsi->bonjourname = NULL;
+}
+
static struct itimerval itimer;
/* accept the socket and do a little sanity checking */
static int dsi_tcp_open(DSI *dsi)
--- /dev/null
+acl_ldap_readconfig: int (dictionary *)
+ad_close: int (struct adouble *, int)
+ad_convert: int (const char *, const struct stat *, const struct vol *, const char **)
+ad_copy_header: int (struct adouble *, struct adouble *)
+add_cachebyname: int (const char *, const uuidp_t, const uuidtype_t, const long unsigned int)
+add_cachebyuuid: int (uuidp_t, const char *, uuidtype_t, const long unsigned int)
+add_charset: charset_t (const char *)
+ad_dir: char *(const char *)
+ad_dtruncate: int (struct adouble *, const off_t)
+adflags2logstr: const char *(int)
+ad_flush: int (struct adouble *)
+ad_forcegetid: uint32_t (struct adouble *)
+adf_pread: ssize_t (struct ad_fd *, void *, size_t, off_t)
+adf_pwrite: ssize_t (struct ad_fd *, const void *, size_t, off_t)
+ad_getattr: int (const struct adouble *, uint16_t *)
+ad_getdate: int (const struct adouble *, unsigned int, uint32_t *)
+ad_getentryoff: off_t (const struct adouble *, int)
+ad_getfuid: uid_t (void)
+ad_getid: uint32_t (struct adouble *, const dev_t, const ino_t, const cnid_t, const void *)
+ad_hf_mode: mode_t (mode_t)
+ad_init: void (struct adouble *, const struct vol *)
+ad_init_old: void (struct adouble *, int, int)
+ad_lock: int (struct adouble *, uint32_t, int, off_t, off_t, int)
+ad_metadata: int (const char *, int, struct adouble *)
+ad_metadataat: int (int, const char *, int, struct adouble *)
+ad_mkdir: int (const char *, mode_t)
+ad_mode: int (const char *, mode_t)
+ad_open: int (struct adouble *, const char *, int, ...)
+ad_openat: int (struct adouble *, int, const char *, int, ...)
+ad_openforks: uint16_t (struct adouble *, uint16_t)
+ad_path: const char *(const char *, int)
+ad_path_ea: const char *(const char *, int)
+ad_path_osx: const char *(const char *, int)
+ad_read: ssize_t (struct adouble *, const uint32_t, off_t, char *, const size_t)
+ad_readfile_init: int (const struct adouble *, const int, off_t *, const int)
+ad_rebuild_adouble_header_ea: int (struct adouble *)
+ad_rebuild_adouble_header_v2: int (struct adouble *)
+ad_refresh: int (const char *, struct adouble *)
+ad_rtruncate: int (struct adouble *, const off_t)
+ad_setattr: int (const struct adouble *, const uint16_t)
+ad_setdate: int (struct adouble *, unsigned int, uint32_t)
+ad_setfuid: int (const uid_t)
+ad_setid: int (struct adouble *, const dev_t, const ino_t, const uint32_t, const cnid_t, const void *)
+ad_setname: int (struct adouble *, const char *)
+ad_size: off_t (const struct adouble *, const uint32_t)
+ad_stat: int (const char *, struct stat *)
+ad_testlock: int (struct adouble *, int, const off_t)
+ad_tmplock: int (struct adouble *, uint32_t, int, off_t, off_t, int)
+ad_unlock: void (struct adouble *, const int, int)
+ad_valid_header_osx: int (const char *)
+ad_write: ssize_t (struct adouble *, uint32_t, off_t, int, const char *, size_t)
+afp_config_parse: int (AFPObj *, char *)
+allow_severity: 5
+apply_ip_mask: void (struct sockaddr *, int)
+atalk_iconv: size_t (atalk_iconv_t, const char **, size_t *, char **, size_t *)
+atalk_iconv_close: int (atalk_iconv_t)
+atalk_iconv_open: atalk_iconv_t (const char *, const char *)
+atalk_register_charset: int (struct charset_functions *)
+balloc: int (bstring, int)
+ballocmin: int (bstring, int)
+bassign: int (bstring, const_bstring)
+bassignblk: int (bstring, const void *, int)
+bassigncstr: int (bstring, const char *)
+bassignformat: int (bstring, const char *, ...)
+bassigngets: int (bstring, bNgetc, void *, char)
+bassignmidstr: int (bstring, const_bstring, int, int)
+bcatblk: int (bstring, const void *, int)
+bcatcstr: int (bstring, const char *)
+bconcat: int (bstring, const_bstring)
+bconchar: int (bstring, char)
+bcstrfree: int (char *)
+bdelete: int (bstring, int, int)
+bdestroy: int (bstring)
+become_root: void (void)
+bfindreplace: int (bstring, const_bstring, const_bstring, int)
+bfindreplacecaseless: int (bstring, const_bstring, const_bstring, int)
+bformat: bstring (const char *, ...)
+bformata: int (bstring, const char *, ...)
+bfromcstr: bstring (const char *)
+bfromcstralloc: bstring (int, const char *)
+bgetsa: int (bstring, bNgetc, void *, char)
+bgetstream: bstring (bNgetc, void *, char)
+binchr: int (const_bstring, int, const_bstring)
+binchrr: int (const_bstring, int, const_bstring)
+binsert: int (bstring, int, const_bstring, unsigned char)
+binsertch: int (bstring, int, int, unsigned char)
+binstr: int (const_bstring, int, const_bstring)
+binstrcaseless: int (const_bstring, int, const_bstring)
+binstrr: int (const_bstring, int, const_bstring)
+binstrrcaseless: int (const_bstring, int, const_bstring)
+biseq: int (const_bstring, const_bstring)
+biseqcaseless: int (const_bstring, const_bstring)
+biseqcstr: int (const_bstring, const char *)
+biseqcstrcaseless: int (const_bstring, const char *)
+bisstemeqblk: int (const_bstring, const void *, int)
+bisstemeqcaselessblk: int (const_bstring, const void *, int)
+bjoin: bstring (const struct bstrList *, const_bstring)
+bjoinInv: bstring (const struct bstrList *, const_bstring)
+blk2bstr: bstring (const void *, int)
+bltrimws: int (bstring)
+bmidstr: bstring (const_bstring, int, int)
+bninchr: int (const_bstring, int, const_bstring)
+bninchrr: int (const_bstring, int, const_bstring)
+bpattern: int (bstring, int)
+bread: bstring (bNread, void *)
+breada: int (bstring, bNread, void *)
+brefcstr: bstring (char *)
+breplace: int (bstring, int, int, const_bstring, unsigned char)
+brtrimws: int (bstring)
+bsbufflength: int (struct bStream *, int)
+bsclose: void *(struct bStream *)
+bseof: int (const struct bStream *)
+bsetstr: int (bstring, int, const_bstring, unsigned char)
+bsopen: struct bStream *(bNread, void *)
+bspeek: int (bstring, const struct bStream *)
+bsplit: struct bstrList *(const_bstring, unsigned char)
+bsplitcb: int (const_bstring, unsigned char, int, int (*)(void *, int, int), void *)
+bsplits: struct bstrList *(const_bstring, const_bstring)
+bsplitscb: int (const_bstring, const_bstring, int, int (*)(void *, int, int), void *)
+bsplitstr: struct bstrList *(const_bstring, const_bstring)
+bsplitstrcb: int (const_bstring, const_bstring, int, int (*)(void *, int, int), void *)
+bsread: int (bstring, struct bStream *, int)
+bsreada: int (bstring, struct bStream *, int)
+bsreadln: int (bstring, struct bStream *, char)
+bsreadlna: int (bstring, struct bStream *, char)
+bsreadlns: int (bstring, struct bStream *, const_bstring)
+bsreadlnsa: int (bstring, struct bStream *, const_bstring)
+bssplitscb: int (struct bStream *, const_bstring, int (*)(void *, int, const_bstring), void *)
+bssplitstrcb: int (struct bStream *, const_bstring, int (*)(void *, int, const_bstring), void *)
+bstr2cstr: char *(const_bstring, char)
+bstrchrp: int (const_bstring, int, int)
+bstrcmp: int (const_bstring, const_bstring)
+bstrcpy: bstring (const_bstring)
+bstricmp: int (const_bstring, const_bstring)
+bstrListAlloc: int (struct bstrList *, int)
+bstrListAllocMin: int (struct bstrList *, int)
+bstrListCreate: struct bstrList *(void)
+bstrListCreateMin: struct bstrList *(int)
+bstrListDestroy: int (struct bstrList *)
+bstrListPop: bstring (struct bstrList *)
+bstrListPush: int (struct bstrList *, bstring)
+bstrncmp: int (const_bstring, const_bstring, int)
+bstrnicmp: int (const_bstring, const_bstring, int)
+bstrrchrp: int (const_bstring, int, int)
+bsunread: int (struct bStream *, const_bstring)
+btolower: int (bstring)
+btoupper: int (bstring)
+btrimws: int (bstring)
+btrunc: int (bstring, int)
+bunrefcstr: int (bstring)
+bvcformata: int (bstring, int, const char *, struct __va_list_tag *)
+charset_decompose: size_t (charset_t, char *, size_t, char *, size_t)
+charset_mac_centraleurope: {name = "MAC_CENTRALEUROPE", kTextEncoding = 29, pull = <mac_centraleurope_pull>, push = <mac_centraleurope_push>, flags = 17, iname = 0x0, prev = 0x0, next = 0x0}
+charset_mac_chinese_simp: {name = "MAC_CHINESE_SIMP", kTextEncoding = 25, pull = <mac_chinese_simp_pull>, push = <mac_chinese_simp_push>, flags = 85, iname = "EUC-CN", prev = 0x0, next = 0x0}
+charset_mac_chinese_trad: {name = "MAC_CHINESE_TRAD", kTextEncoding = 2, pull = <mac_chinese_trad_pull>, push = <mac_chinese_trad_push>, flags = 85, iname = "BIG-5", prev = 0x0, next = 0x0}
+charset_mac_cyrillic: {name = "MAC_CYRILLIC", kTextEncoding = 7, pull = <mac_cyrillic_pull>, push = <mac_cyrillic_push>, flags = 17, iname = 0x0, prev = 0x0, next = 0x0}
+charset_mac_greek: {name = "MAC_GREEK", kTextEncoding = 6, pull = <mac_greek_pull>, push = <mac_greek_push>, flags = 17, iname = 0x0, prev = 0x0, next = 0x0}
+charset_mac_hebrew: {name = "MAC_HEBREW", kTextEncoding = 5, pull = <mac_hebrew_pull>, push = <mac_hebrew_push>, flags = 17, iname = 0x0, prev = 0x0, next = 0x0}
+charset_mac_japanese: {name = "MAC_JAPANESE", kTextEncoding = 1, pull = <mac_japanese_pull>, push = <mac_japanese_push>, flags = 85, iname = "SHIFT_JIS", prev = 0x0, next = 0x0}
+charset_mac_korean: {name = "MAC_KOREAN", kTextEncoding = 3, pull = <mac_korean_pull>, push = <mac_korean_push>, flags = 85, iname = "EUC-KR", prev = 0x0, next = 0x0}
+charset_mac_roman: {name = "MAC_ROMAN", kTextEncoding = 0, pull = <mac_roman_pull>, push = <mac_roman_push>, flags = 21, iname = 0x0, prev = 0x0, next = 0x0}
+charset_mac_turkish: {name = "MAC_TURKISH", kTextEncoding = 35, pull = <mac_turkish_pull>, push = <mac_turkish_push>, flags = 17, iname = 0x0, prev = 0x0, next = 0x0}
+charset_precompose: size_t (charset_t, char *, size_t, char *, size_t)
+charset_strlower: size_t (charset_t, const char *, size_t, char *, size_t)
+charset_strupper: size_t (charset_t, const char *, size_t, char *, size_t)
+charset_to_ucs2_allocate: size_t (charset_t, uint16_t **, const char *)
+charset_to_utf8_allocate: size_t (charset_t, char **, const char *)
+charset_utf8: {name = "UTF8", kTextEncoding = 134217987, pull = <utf8_pull>, push = <utf8_push>, flags = 22, iname = 0x0, prev = 0x0, next = 0x0}
+charset_utf8_mac: {name = "UTF8-MAC", kTextEncoding = 134217987, pull = <utf8_pull>, push = <utf8_push>, flags = 27, iname = 0x0, prev = 0x0, next = 0x0}
+check_lockfile: int (const char *, const char *)
+cjk_char_pull: size_t (uint16_t, uint16_t *, const uint32_t *)
+cjk_char_push: size_t (uint16_t, uint8_t *)
+cjk_compose: uint16_t (uint16_t, uint16_t, const uint32_t *, size_t)
+cjk_compose_seq: uint16_t (const uint16_t *, size_t *, const uint32_t *, size_t)
+cjk_generic_pull: size_t (size_t (*)(uint16_t *, const uint8_t *, size_t *), void *, char **, size_t *, char **, size_t *)
+cjk_generic_push: size_t (size_t (*)(uint8_t *, const uint16_t *, size_t *), void *, char **, size_t *, char **, size_t *)
+cjk_lookup: uint16_t (uint16_t, const cjk_index_t *, const uint16_t *)
+cnid_add: cnid_t (struct _cnid_db *, const struct stat *, const cnid_t, const char *, const size_t, cnid_t)
+cnid_close: void (struct _cnid_db *)
+cnid_dbd_add: cnid_t (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t, cnid_t)
+cnid_dbd_close: void (struct _cnid_db *)
+cnid_dbd_delete: int (struct _cnid_db *, const cnid_t)
+cnid_dbd_find: int (struct _cnid_db *, const char *, size_t, void *, size_t)
+cnid_dbd_get: cnid_t (struct _cnid_db *, cnid_t, const char *, size_t)
+cnid_dbd_getstamp: int (struct _cnid_db *, void *, const size_t)
+cnid_dbd_lookup: cnid_t (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t)
+cnid_dbd_module: {name = "dbd", db_list = {next = 0x0, prev = 0x0}, cnid_open = 0, flags = 0}
+cnid_dbd_open: struct _cnid_db *(struct cnid_open_args *)
+cnid_dbd_rebuild_add: cnid_t (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t, cnid_t)
+cnid_dbd_resolve: char *(struct _cnid_db *, cnid_t *, void *, size_t)
+cnid_dbd_update: int (struct _cnid_db *, cnid_t, const struct stat *, cnid_t, const char *, size_t)
+cnid_delete: int (struct _cnid_db *, cnid_t)
+cnid_find: int (struct _cnid_db *, const char *, size_t, void *, size_t)
+cnid_get: cnid_t (struct _cnid_db *, const cnid_t, char *, const size_t)
+cnid_getstamp: int (struct _cnid_db *, void *, const size_t)
+cnid_init: void (void)
+cnid_last_add: cnid_t (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t, cnid_t)
+cnid_last_close: void (struct _cnid_db *)
+cnid_last_delete: int (struct _cnid_db *, const cnid_t)
+cnid_last_get: cnid_t (struct _cnid_db *, cnid_t, const char *, size_t)
+cnid_last_lookup: cnid_t (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t)
+cnid_last_module: {name = "last", db_list = {next = 0x0, prev = 0x0}, cnid_open = 0, flags = 0}
+cnid_last_open: struct _cnid_db *(struct cnid_open_args *)
+cnid_last_resolve: char *(struct _cnid_db *, cnid_t *, void *, size_t)
+cnid_last_update: int (struct _cnid_db *, cnid_t, const struct stat *, cnid_t, const char *, size_t)
+cnid_lookup: cnid_t (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t)
+cnid_open: struct _cnid_db *(const char *, mode_t, char *, int, const char *, const char *)
+cnid_rebuild_add: cnid_t (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t, cnid_t)
+cnid_register: void (struct _cnid_module *)
+cnid_resolve: char *(struct _cnid_db *, cnid_t *, void *, size_t)
+cnid_tdb_add: cnid_t (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t, cnid_t)
+cnid_tdb_close: void (struct _cnid_db *)
+cnid_tdb_delete: int (struct _cnid_db *, const cnid_t)
+cnid_tdb_get: cnid_t (struct _cnid_db *, cnid_t, const char *, size_t)
+cnid_tdb_lookup: cnid_t (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t)
+cnid_tdb_module: {name = "tdb", db_list = {next = 0x0, prev = 0x0}, cnid_open = 0, flags = 12}
+cnid_tdb_open: struct _cnid_db *(struct cnid_open_args *)
+cnid_tdb_resolve: char *(struct _cnid_db *, cnid_t *, void *, size_t)
+cnid_tdb_update: int (struct _cnid_db *, cnid_t, const struct stat *, cnid_t, const char *, size_t)
+cnid_update: int (struct _cnid_db *, const cnid_t, const struct stat *, const cnid_t, char *, const size_t)
+compare_ip: int (const struct sockaddr *, const struct sockaddr *)
+convert_charset: size_t (charset_t, charset_t, charset_t, const char *, size_t, char *, size_t, uint16_t *)
+convert_string: size_t (charset_t, charset_t, const void *, size_t, void *, size_t)
+convert_string_allocate: size_t (charset_t, charset_t, const void *, size_t, char **)
+copy_ea: int (const char *, int, const char *, const char *, mode_t)
+copy_file: int (int, const char *, const char *, mode_t)
+copy_file_fd: int (int, int)
+copy_fork: int (int, struct adouble *, struct adouble *)
+create_lockfile: int (const char *, const char *)
+daemonize: int (int, int)
+decompose_w: size_t (uint16_t *, size_t, uint16_t *, size_t *)
+deny_severity: 3
+dequeue: void *(q_t *)
+_diacasemap: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 231, 203, 229, 128, 204, 129, 130, 131, 233, 230, 232, 234, 237, 235, 236, 132, 238, 241, 239, 133, 205, 242, 244, 243, 134, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 198, 183, 184, 184, 186, 187, 188, 189, 174, 175, 192, 193, 194, 195, 196, 197, 198, 199...}
+_dialowermap: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 138, 140, 141, 142, 150, 154, 159, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 132, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 190, 191, 176, 177, 178, 179, 180, 181, 198, 183, 185, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199...}
+dictionary_del: void (dictionary *)
+dictionary_dump: void (dictionary *, FILE *)
+dictionary_get: const char *(const dictionary *, const char *, const char *, const char *)
+dictionary_hash: unsigned int (char *)
+dictionary_new: dictionary *(int)
+dictionary_set: int (dictionary *, char *, char *, char *)
+dictionary_unset: void (dictionary *, char *, char *)
+dir_rx_set: int (mode_t)
+dsi_attention: int (DSI *, AFPUserBytes)
+dsi_close: void (DSI *)
+dsi_cmdreply: int (DSI *, const int)
+dsi_disconnect: int (DSI *)
+dsi_getsession: int (DSI *, server_child *, int, afp_child_t **)
+dsi_getstatus: void (DSI *)
+dsi_init: DSI *(AFPObj *, const char *, const char *, const char *)
+dsi_opensession: void (DSI *)
+dsi_read: ssize_t (DSI *, void *, const size_t)
+dsi_readdone: void (DSI *)
+dsi_readinit: ssize_t (DSI *, void *, const size_t, const size_t, const int)
+dsi_stream_read: size_t (DSI *, void *, const size_t)
+dsi_stream_read_file: ssize_t (DSI *, const int, off_t, const size_t, const int)
+dsi_stream_receive: int (DSI *)
+dsi_stream_send: int (DSI *, void *, size_t)
+dsi_stream_write: ssize_t (DSI *, void *, const size_t, int)
+dsi_tcp_init: int (DSI *, const char *, const char *, const char *)
+dsi_tickle: int (DSI *)
+dsi_write: size_t (DSI *, void *, const size_t)
+dsi_writeflush: void (DSI *)
+dsi_writeinit: size_t (DSI *, void *, const size_t)
+ea_chmod_dir: int (const struct vol *, const char *, mode_t, struct stat *)
+ea_chmod_file: int (const struct vol *, const char *, mode_t, struct stat *)
+ea_chown: int (const struct vol *, const char *, uid_t, gid_t)
+ea_close: int (struct ea *)
+ea_copyfile: int (const struct vol *, int, const char *, const char *)
+ea_deletefile: int (const struct vol *, int, const char *)
+ea_open: int (const struct vol *, const char *, eaflags_t, struct ea *)
+ea_openat: int (const struct vol *, int, const char *, eaflags_t, struct ea *)
+ea_path: char *(const struct ea *, const char *, int)
+ea_renamefile: int (const struct vol *, int, const char *, const char *)
+enqueue: qnode_t *(q_t *, void *)
+fault_setup: void (void (*)(void *))
+fdset_add_fd: void (int, struct pollfd **, struct polldata **, int *, int *, int, enum fdtype, void *)
+fdset_del_fd: void (struct pollfd **, struct polldata **, int *, int *, int)
+find_charset_functions: struct charset_functions *(const char *)
+_fini: <text variable, no debug info>
+freeifacelist: void (char **)
+fullpathname: const char *(const char *)
+getcwdpath: const char *(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 *)
+getifacelist: char **(void)
+getip_port: unsigned int (const struct sockaddr *)
+getip_string: const char *(const struct sockaddr *)
+getnamefromuuid: int (const uuidp_t, char **, uuidtype_t *)
+getuuidfromname: int (const char *, uuidtype_t, unsigned char *)
+getvolbyname: struct vol *(const char *)
+getvolbypath: struct vol *(AFPObj *, const char *)
+getvolbyvid: struct vol *(const uint16_t)
+getvolumes: struct vol *(void)
+gmem: int (gid_t, int, gid_t *)
+iniparser_dump: void (const dictionary *, FILE *)
+iniparser_dump_ini: void (const dictionary *, FILE *)
+iniparser_find_entry: int (const dictionary *, const char *)
+iniparser_freedict: void (dictionary *)
+iniparser_getboolean: int (const dictionary *, const char *, const char *, int)
+iniparser_getdouble: double (const dictionary *, const char *, const char *, double)
+iniparser_getint: int (const dictionary *, const char *, const char *, int)
+iniparser_getnsec: int (const dictionary *)
+iniparser_getsecname: const char *(const dictionary *, int)
+iniparser_getstrdup: char *(const dictionary *, const char *, const char *, const char *)
+iniparser_getstring: const char *(const dictionary *, const char *, const char *, const char *)
+iniparser_load: dictionary *(const char *)
+iniparser_set: int (dictionary *, char *, char *, char *)
+iniparser_unset: void (dictionary *, char *, char *)
+_init: <text variable, no debug info>
+init_iconv: void (void)
+initvol_vfs: void (struct vol *)
+ipc_child_write: int (int, uint16_t, int, void *)
+ipc_client_uds: int (const char *)
+ipc_server_read: int (server_child *, int)
+ipc_server_uds: int (const char *)
+islower_sp: int (uint32_t)
+islower_w: int (uint16_t)
+isupper_sp: int (uint32_t)
+isupper_w: int (uint16_t)
+lchdir: int (const char *)
+ldap_auth_dn: 0x0
+ldap_auth_method: 0
+ldap_auth_pw: 0x0
+ldap_config_valid: 0
+ldap_getnamefromuuid: int (const char *, char **, uuidtype_t *)
+ldap_getuuidfromname: int (const char *, uuidtype_t, char **)
+ldap_group_attr: 0x0
+ldap_groupbase: 0x0
+ldap_groupscope: 0
+ldap_name_attr: 0x0
+ldap_prefs: {{pref = 0x0, name = "ldap server", strorint = 0, intfromarray = 0, valid = -1}, {pref = 0x0, name = "ldap auth method", strorint = 1, intfromarray = 1, valid = -1}, {pref = 0x0, name = "ldap auth dn", strorint = 0, intfromarray = 0, valid = 0}, {pref = 0x0, name = "ldap auth pw", strorint = 0, intfromarray = 0, valid = 0}, {pref = 0x0, name = "ldap userbase", strorint = 0, intfromarray = 0, valid = -1}, {pref = 0x0, name = "ldap userscope", strorint = 1, intfromarray = 1, valid = -1}, {pref = 0x0, name = "ldap groupbase", strorint = 0, intfromarray = 0, valid = -1}, {pref = 0x0, name = "ldap groupscope", strorint = 1, intfromarray = 1, valid = -1}, {pref = 0x0, name = "ldap uuid attr", strorint = 0, intfromarray = 0, valid = -1}, {pref = 0x0, name = "ldap uuid string", strorint = 0, intfromarray = 0, valid = 0}, {pref = 0x0, name = "ldap name attr", strorint = 0, intfromarray = 0, valid = -1}, {pref = 0x0, name = "ldap group attr", strorint = 0, intfromarray = 0, valid = -1}, {pref = 0x0, name = "ldap uid attr", strorint = 0, intfromarray = 0, valid = 0}, {pref = 0x0, name = "ldap uuid encoding", strorint = 1, intfromarray = 1, valid = 0}, {pref = 0x0, name = 0x0, strorint = 0, intfromarray = 0, valid = -1}}
+ldap_server: 0x0
+ldap_uid_attr: 0x0
+ldap_userbase: 0x0
+ldap_userscope: 0
+ldap_uuid_attr: 0x0
+ldap_uuid_encoding: 0
+ldap_uuid_string: 0x0
+list_eas: int (const struct vol *, char *, size_t *, const char *, int)
+load_charset: int (struct vol *)
+load_volumes: int (AFPObj *, void (*)(const AFPObj *, struct vol *))
+localuuid_from_id: void (unsigned char *, uuidtype_t, unsigned int)
+lock_reg: int (int, int, int, off_t, int, off_t)
+log_config: {inited = false, syslog_opened = false, console = false, processname = '\0' <repeats 15 times>, syslog_facility = 0, syslog_display_options = 0}
+lstatat: int (int, const char *, struct stat *)
+make_log_entry: void (enum loglevels, enum logtypes, const char *, int, char *, ...)
+make_tdb_data: unsigned char *(uint32_t, const struct stat *, const cnid_t, const char *, const size_t)
+mb_generic_pull: size_t (int (*)(uint16_t *, const unsigned char *), void *, char **, size_t *, char **, size_t *)
+mb_generic_push: size_t (int (*)(unsigned char *, uint16_t), void *, char **, size_t *, char **, size_t *)
+netatalk_panic: void (const char *)
+netatalk_rmdir: int (int, const char *)
+netatalk_rmdir_all_errors: int (int, const char *)
+netatalk_unlink: int (const char *)
+netatalk_unlinkat: int (int, const char *)
+nftw: int (const char *, nftw_func_t, dir_notification_func_t, int, int)
+opendirat: DIR *(int, const char *)
+openflags2logstr: const char *(int)
+posix_chmod: int (const char *, mode_t)
+posix_fchmod: int (int, mode_t)
+precompose_w: size_t (uint16_t *, size_t, uint16_t *, size_t *)
+prefs_array: {{pref = "ldap auth method", valuestring = "none", value = 0}, {pref = "ldap auth method", valuestring = "simple", value = 128}, {pref = "ldap auth method", valuestring = "sasl", value = 163}, {pref = "ldap userscope", valuestring = "base", value = 0}, {pref = "ldap userscope", valuestring = "one", value = 1}, {pref = "ldap userscope", valuestring = "sub", value = 2}, {pref = "ldap groupscope", valuestring = "base", value = 0}, {pref = "ldap groupscope", valuestring = "one", value = 1}, {pref = "ldap groupscope", valuestring = "sub", value = 2}, {pref = "ldap uuid encoding", valuestring = "ms-guid", value = 1}, {pref = "ldap uuid encoding", valuestring = "string", value = 0}, {pref = 0x0, valuestring = 0x0, value = 0}}
+prequeue: qnode_t *(q_t *, void *)
+queue_destroy: void (q_t *, void (*)(void *))
+queue_init: q_t *(void)
+randombytes: void (void *, int)
+readt: ssize_t (int, void *, const size_t, int, int)
+reconnect_ipc: int (AFPObj *)
+recv_fd: int (int, int)
+rel_path_in_vol: bstring (const char *, const char *)
+remove_acl_vfs: int (const char *)
+remove_ea: int (const struct vol *, const char *, const char *, int)
+run_cmd: int (const char *, char **)
+search_cachebyname: int (const char *, uuidtype_t *, unsigned char *)
+search_cachebyuuid: int (uuidp_t, char **, uuidtype_t *)
+send_fd: int (int, int)
+server_child_add: afp_child_t *(server_child *, int, pid_t, int)
+server_child_alloc: server_child *(const int, const int)
+server_child_free: void (server_child *)
+server_child_kill: void (server_child *, int, int)
+server_child_kill_one_by_id: void (server_child *, int, pid_t, uid_t, uint32_t, char *, uint32_t)
+server_child_remove: int (server_child *, const int, pid_t)
+server_child_setup: void (server_child *, const int, void (*)(const pid_t))
+server_child_transfer_session: int (server_child *, int, pid_t, uid_t, int, uint16_t)
+server_lock: pid_t (char *, char *, int)
+server_reset_signal: void (void)
+set_charset_name: int (charset_t, const char *)
+set_ea: int (const struct vol *, const char *, const char *, const char *, size_t, int)
+setfilmode: int (const char *, mode_t, struct stat *, mode_t)
+setnonblock: int (int, int)
+set_processname: void (const char *)
+setuplog: void (const char *, const char *)
+statat: int (int, const char *, struct stat *)
+strcasechr_sp: uint16_t *(const uint16_t *, uint32_t)
+strcasechr_w: uint16_t *(const uint16_t *, uint16_t)
+strcasecmp_w: int (const uint16_t *, const uint16_t *)
+strcasestr_w: uint16_t *(const uint16_t *, const uint16_t *)
+strcat_w: uint16_t *(uint16_t *, const uint16_t *)
+strchr_w: uint16_t *(const uint16_t *, uint16_t)
+strcmp_w: int (const uint16_t *, const uint16_t *)
+strdiacasecmp: int (const char *, const char *)
+strdup_w: uint16_t *(const uint16_t *)
+stripped_slashes_basename: char *(char *)
+strlcat: size_t (char *, const char *, size_t)
+strlcpy: size_t (char *, const char *, size_t)
+strlen_w: size_t (const uint16_t *)
+strlower_w: int (uint16_t *)
+strncasecmp_w: int (const uint16_t *, const uint16_t *, size_t)
+strncat_w: uint16_t *(uint16_t *, const uint16_t *, const size_t)
+strncmp_w: int (const uint16_t *, const uint16_t *, size_t)
+strncpy_w: uint16_t *(uint16_t *, const uint16_t *, const size_t)
+strndiacasecmp: int (const char *, const char *, size_t)
+strndup_w: uint16_t *(const uint16_t *, size_t)
+strnlen_w: size_t (const uint16_t *, size_t)
+strstr_w: uint16_t *(const uint16_t *, const uint16_t *)
+strupper_w: int (uint16_t *)
+sys_ea_copyfile: int (const struct vol *, int, const char *, const char *)
+sys_fgetxattr: ssize_t (int, const char *, void *, size_t)
+sys_fsetxattr: int (int, const char *, const void *, size_t, int)
+sys_ftruncate: int (int, off_t)
+sys_get_eacontent: int (const struct vol *, char *, size_t *, const char *, int, const char *, int)
+sys_get_easize: int (const struct vol *, char *, size_t *, const char *, int, const char *)
+sys_getxattr: ssize_t (const char *, const char *, void *, size_t)
+sys_getxattrfd: int (int, const char *, int, ...)
+sys_lgetxattr: ssize_t (const char *, const char *, void *, size_t)
+sys_list_eas: int (const struct vol *, char *, size_t *, const char *, int)
+sys_listxattr: ssize_t (const char *, char *, size_t)
+sys_llistxattr: ssize_t (const char *, char *, size_t)
+sys_lremovexattr: int (const char *, const char *)
+sys_lsetxattr: int (const char *, const char *, const void *, size_t, int)
+sys_remove_ea: int (const struct vol *, const char *, const char *, int)
+sys_removexattr: int (const char *, const char *)
+sys_sendfile: ssize_t (int, int, off_t *, size_t)
+sys_set_ea: int (const struct vol *, const char *, const char *, const char *, size_t, int)
+sys_setxattr: int (const char *, const char *, const void *, size_t, int)
+tdb_add_flags: void (struct tdb_context *, unsigned int)
+tdb_allocate: tdb_off_t (struct tdb_context *, tdb_len_t, struct tdb_record *)
+tdb_alloc_read: unsigned char *(struct tdb_context *, tdb_off_t, tdb_len_t)
+tdb_append: int (struct tdb_context *, TDB_DATA, TDB_DATA)
+tdb_brlock: int (struct tdb_context *, tdb_off_t, int, int, int, size_t)
+tdb_brlock_upgrade: int (struct tdb_context *, tdb_off_t, size_t)
+tdb_chainlock: int (struct tdb_context *, TDB_DATA)
+tdb_chainlock_mark: int (struct tdb_context *, TDB_DATA)
+tdb_chainlock_nonblock: int (struct tdb_context *, TDB_DATA)
+tdb_chainlock_read: int (struct tdb_context *, TDB_DATA)
+tdb_chainlock_unmark: int (struct tdb_context *, TDB_DATA)
+tdb_chainunlock: int (struct tdb_context *, TDB_DATA)
+tdb_chainunlock_read: int (struct tdb_context *, TDB_DATA)
+tdb_check: int (struct tdb_context *, int (*)(TDB_DATA, TDB_DATA, void *), void *)
+tdb_close: int (struct tdb_context *)
+tdb_convert: void *(void *, uint32_t)
+tdb_delete: int (struct tdb_context *, TDB_DATA)
+tdb_do_delete: int (struct tdb_context *, tdb_off_t, struct tdb_record *)
+tdb_dump_all: void (struct tdb_context *)
+tdb_enable_seqnum: void (struct tdb_context *)
+tdb_error: enum TDB_ERROR (struct tdb_context *)
+tdb_errorstr: const char *(struct tdb_context *)
+tdb_exists: int (struct tdb_context *, TDB_DATA)
+tdb_expand: int (struct tdb_context *, tdb_off_t)
+tdb_fd: int (struct tdb_context *)
+tdb_fetch: TDB_DATA (struct tdb_context *, TDB_DATA)
+tdb_find_lock_hash: tdb_off_t (struct tdb_context *, TDB_DATA, uint32_t, int, struct tdb_record *)
+tdb_firstkey: TDB_DATA (struct tdb_context *)
+tdb_free: int (struct tdb_context *, tdb_off_t, struct tdb_record *)
+tdb_freelist_size: int (struct tdb_context *)
+tdb_get_flags: int (struct tdb_context *)
+tdb_get_logging_private: void *(struct tdb_context *)
+tdb_get_seqnum: int (struct tdb_context *)
+tdb_hash_size: int (struct tdb_context *)
+tdb_increment_seqnum_nonblock: void (struct tdb_context *)
+tdb_io_init: void (struct tdb_context *)
+tdb_lock: int (struct tdb_context *, int, int)
+tdb_lockall: int (struct tdb_context *)
+tdb_lockall_mark: int (struct tdb_context *)
+tdb_lockall_nonblock: int (struct tdb_context *)
+tdb_lockall_read: int (struct tdb_context *)
+tdb_lockall_read_nonblock: int (struct tdb_context *)
+tdb_lockall_unmark: int (struct tdb_context *)
+tdb_lock_nonblock: int (struct tdb_context *, int, int)
+tdb_lock_record: int (struct tdb_context *, tdb_off_t)
+tdb_log_fn: tdb_log_func (struct tdb_context *)
+tdb_map_size: size_t (struct tdb_context *)
+tdb_mmap: void (struct tdb_context *)
+tdb_munmap: int (struct tdb_context *)
+tdb_name: const char *(struct tdb_context *)
+tdb_nextkey: TDB_DATA (struct tdb_context *, TDB_DATA)
+tdb_null: {dptr = 0x0, dsize = 0}
+tdb_ofs_read: int (struct tdb_context *, tdb_off_t, tdb_off_t *)
+tdb_ofs_write: int (struct tdb_context *, tdb_off_t, tdb_off_t *)
+tdb_open: struct tdb_context *(const char *, int, int, int, mode_t)
+tdb_open_ex: struct tdb_context *(const char *, int, int, int, mode_t, const struct tdb_logging_context *, tdb_hash_func)
+tdb_parse_data: int (struct tdb_context *, TDB_DATA, tdb_off_t, tdb_len_t, int (*)(TDB_DATA, TDB_DATA, void *), void *)
+tdb_parse_record: int (struct tdb_context *, TDB_DATA, int (*)(TDB_DATA, TDB_DATA, void *), void *)
+tdb_printfreelist: int (struct tdb_context *)
+tdb_rec_free_read: int (struct tdb_context *, tdb_off_t, struct tdb_record *)
+tdb_rec_read: int (struct tdb_context *, tdb_off_t, struct tdb_record *)
+tdb_rec_write: int (struct tdb_context *, tdb_off_t, struct tdb_record *)
+tdb_remove_flags: void (struct tdb_context *, unsigned int)
+tdb_reopen: int (struct tdb_context *)
+tdb_reopen_all: int (int)
+tdb_repack: int (struct tdb_context *)
+tdb_setalarm_sigptr: void (struct tdb_context *, volatile sig_atomic_t *)
+tdb_set_logging_function: void (struct tdb_context *, const struct tdb_logging_context *)
+tdb_set_max_dead: void (struct tdb_context *, int)
+tdb_store: int (struct tdb_context *, TDB_DATA, TDB_DATA, int)
+_tdb_transaction_cancel: int (struct tdb_context *)
+tdb_transaction_cancel: int (struct tdb_context *)
+tdb_transaction_commit: int (struct tdb_context *)
+tdb_transaction_lock: int (struct tdb_context *, int)
+tdb_transaction_prepare_commit: int (struct tdb_context *)
+tdb_transaction_recover: int (struct tdb_context *)
+tdb_transaction_start: int (struct tdb_context *)
+tdb_transaction_unlock: int (struct tdb_context *)
+tdb_traverse: int (struct tdb_context *, tdb_traverse_func, void *)
+tdb_traverse_read: int (struct tdb_context *, tdb_traverse_func, void *)
+tdb_unlock: int (struct tdb_context *, int, int)
+tdb_unlockall: int (struct tdb_context *)
+tdb_unlockall_read: int (struct tdb_context *)
+tdb_unlock_record: int (struct tdb_context *, tdb_off_t)
+tdb_validate_freelist: int (struct tdb_context *, int *)
+tdb_wipe_all: int (struct tdb_context *)
+tdb_write_lock_record: int (struct tdb_context *, tdb_off_t)
+tdb_write_unlock_record: int (struct tdb_context *, tdb_off_t)
+tolower_sp: uint32_t (uint32_t)
+tolower_w: uint16_t (uint16_t)
+toupper_sp: uint32_t (uint32_t)
+toupper_w: uint16_t (uint16_t)
+type_configs: {{set = false, syslog = false, fd = -1, level = log_none, display_options = 0}, {set = false, syslog = false, fd = -1, level = log_none, display_options = 0}, {set = false, syslog = false, fd = -1, level = log_none, display_options = 0}, {set = false, syslog = false, fd = -1, level = log_none, display_options = 0}, {set = false, syslog = false, fd = -1, level = log_none, display_options = 0}, {set = false, syslog = false, fd = -1, level = log_none, display_options = 0}, {set = false, syslog = false, fd = -1, level = log_none, display_options = 0}, {set = false, syslog = false, fd = -1, level = log_none, display_options = 0}}
+ucs2_to_charset: size_t (charset_t, const uint16_t *, char *, size_t)
+ucs2_to_charset_allocate: size_t (charset_t, char **, const uint16_t *)
+unbecome_root: void (void)
+unix_rename: int (int, const char *, int, const char *)
+unix_strlower: size_t (const char *, size_t, char *, size_t)
+unix_strupper: size_t (const char *, size_t, char *, size_t)
+unload_volumes: void (AFPObj *)
+utf8_charlen: size_t (char *)
+utf8_decompose: size_t (char *, size_t, char *, size_t)
+utf8_precompose: size_t (char *, size_t, char *, size_t)
+utf8_strlen_validate: size_t (char *)
+utf8_strlower: size_t (const char *, size_t, char *, size_t)
+utf8_strupper: size_t (const char *, size_t, char *, size_t)
+utf8_to_charset_allocate: size_t (charset_t, char **, const char *)
+uuid_bin2string: const char *(const unsigned char *)
+uuidcache_dump: void (void)
+uuid_string2bin: void (const char *, unsigned char *)
+uuidtype: {"", "USER", "GROUP", "LOCAL"}
+volume_free: void (struct vol *)
+volume_unlink: void (struct vol *)
+writet: ssize_t (int, void *, const size_t, int, int)
--- /dev/null
+acl_ldap_readconfig: int (dictionary *)
+ad_close: int (struct adouble *, int)
+ad_convert: int (const char *, const struct stat *, const struct vol *, const char **)
+ad_copy_header: int (struct adouble *, struct adouble *)
+add_cachebyname: int (const char *, const uuidp_t, const uuidtype_t, const long unsigned int)
+add_cachebyuuid: int (uuidp_t, const char *, uuidtype_t, const long unsigned int)
+add_charset: charset_t (const char *)
+ad_dir: char *(const char *)
+ad_dtruncate: int (struct adouble *, const off_t)
+adflags2logstr: const char *(int)
+ad_flush: int (struct adouble *)
+ad_forcegetid: uint32_t (struct adouble *)
+adf_pread: ssize_t (struct ad_fd *, void *, size_t, off_t)
+adf_pwrite: ssize_t (struct ad_fd *, const void *, size_t, off_t)
+ad_getattr: int (const struct adouble *, uint16_t *)
+ad_getdate: int (const struct adouble *, unsigned int, uint32_t *)
+ad_getentryoff: off_t (const struct adouble *, int)
+ad_getfuid: uid_t (void)
+ad_getid: uint32_t (struct adouble *, const dev_t, const ino_t, const cnid_t, const void *)
+ad_hf_mode: mode_t (mode_t)
+ad_init: void (struct adouble *, const struct vol *)
+ad_init_old: void (struct adouble *, int, int)
+ad_lock: int (struct adouble *, uint32_t, int, off_t, off_t, int)
+ad_metadata: int (const char *, int, struct adouble *)
+ad_metadataat: int (int, const char *, int, struct adouble *)
+ad_mkdir: int (const char *, mode_t)
+ad_mode: int (const char *, mode_t)
+ad_open: int (struct adouble *, const char *, int, ...)
+ad_openat: int (struct adouble *, int, const char *, int, ...)
+ad_openforks: uint16_t (struct adouble *, uint16_t)
+ad_path: const char *(const char *, int)
+ad_path_ea: const char *(const char *, int)
+ad_path_osx: const char *(const char *, int)
+ad_read: ssize_t (struct adouble *, const uint32_t, off_t, char *, const size_t)
+ad_readfile_init: int (const struct adouble *, const int, off_t *, const int)
+ad_rebuild_adouble_header_ea: int (struct adouble *)
+ad_rebuild_adouble_header_v2: int (struct adouble *)
+ad_refresh: int (const char *, struct adouble *)
+ad_rtruncate: int (struct adouble *, const off_t)
+ad_setattr: int (const struct adouble *, const uint16_t)
+ad_setdate: int (struct adouble *, unsigned int, uint32_t)
+ad_setfuid: int (const uid_t)
+ad_setid: int (struct adouble *, const dev_t, const ino_t, const uint32_t, const cnid_t, const void *)
+ad_setname: int (struct adouble *, const char *)
+ad_size: off_t (const struct adouble *, const uint32_t)
+ad_stat: int (const char *, struct stat *)
+ad_testlock: int (struct adouble *, int, const off_t)
+ad_tmplock: int (struct adouble *, uint32_t, int, off_t, off_t, int)
+ad_unlock: void (struct adouble *, const int, int)
+ad_valid_header_osx: int (const char *)
+ad_write: ssize_t (struct adouble *, uint32_t, off_t, int, const char *, size_t)
+afp_config_parse: int (AFPObj *, char *)
+allow_severity: 5
+apply_ip_mask: void (struct sockaddr *, int)
+atalk_iconv: size_t (atalk_iconv_t, const char **, size_t *, char **, size_t *)
+atalk_iconv_close: int (atalk_iconv_t)
+atalk_iconv_open: atalk_iconv_t (const char *, const char *)
+atalk_register_charset: int (struct charset_functions *)
+balloc: int (bstring, int)
+ballocmin: int (bstring, int)
+bassign: int (bstring, const_bstring)
+bassignblk: int (bstring, const void *, int)
+bassigncstr: int (bstring, const char *)
+bassignformat: int (bstring, const char *, ...)
+bassigngets: int (bstring, bNgetc, void *, char)
+bassignmidstr: int (bstring, const_bstring, int, int)
+bcatblk: int (bstring, const void *, int)
+bcatcstr: int (bstring, const char *)
+bconcat: int (bstring, const_bstring)
+bconchar: int (bstring, char)
+bcstrfree: int (char *)
+bdelete: int (bstring, int, int)
+bdestroy: int (bstring)
+become_root: void (void)
+bfindreplace: int (bstring, const_bstring, const_bstring, int)
+bfindreplacecaseless: int (bstring, const_bstring, const_bstring, int)
+bformat: bstring (const char *, ...)
+bformata: int (bstring, const char *, ...)
+bfromcstr: bstring (const char *)
+bfromcstralloc: bstring (int, const char *)
+bgetsa: int (bstring, bNgetc, void *, char)
+bgetstream: bstring (bNgetc, void *, char)
+binchr: int (const_bstring, int, const_bstring)
+binchrr: int (const_bstring, int, const_bstring)
+binsert: int (bstring, int, const_bstring, unsigned char)
+binsertch: int (bstring, int, int, unsigned char)
+binstr: int (const_bstring, int, const_bstring)
+binstrcaseless: int (const_bstring, int, const_bstring)
+binstrr: int (const_bstring, int, const_bstring)
+binstrrcaseless: int (const_bstring, int, const_bstring)
+biseq: int (const_bstring, const_bstring)
+biseqcaseless: int (const_bstring, const_bstring)
+biseqcstr: int (const_bstring, const char *)
+biseqcstrcaseless: int (const_bstring, const char *)
+bisstemeqblk: int (const_bstring, const void *, int)
+bisstemeqcaselessblk: int (const_bstring, const void *, int)
+bjoin: bstring (const struct bstrList *, const_bstring)
+bjoinInv: bstring (const struct bstrList *, const_bstring)
+blk2bstr: bstring (const void *, int)
+bltrimws: int (bstring)
+bmidstr: bstring (const_bstring, int, int)
+bninchr: int (const_bstring, int, const_bstring)
+bninchrr: int (const_bstring, int, const_bstring)
+bpattern: int (bstring, int)
+bread: bstring (bNread, void *)
+breada: int (bstring, bNread, void *)
+brefcstr: bstring (char *)
+breplace: int (bstring, int, int, const_bstring, unsigned char)
+brtrimws: int (bstring)
+bsbufflength: int (struct bStream *, int)
+bsclose: void *(struct bStream *)
+bseof: int (const struct bStream *)
+bsetstr: int (bstring, int, const_bstring, unsigned char)
+bsopen: struct bStream *(bNread, void *)
+bspeek: int (bstring, const struct bStream *)
+bsplit: struct bstrList *(const_bstring, unsigned char)
+bsplitcb: int (const_bstring, unsigned char, int, int (*)(void *, int, int), void *)
+bsplits: struct bstrList *(const_bstring, const_bstring)
+bsplitscb: int (const_bstring, const_bstring, int, int (*)(void *, int, int), void *)
+bsplitstr: struct bstrList *(const_bstring, const_bstring)
+bsplitstrcb: int (const_bstring, const_bstring, int, int (*)(void *, int, int), void *)
+bsread: int (bstring, struct bStream *, int)
+bsreada: int (bstring, struct bStream *, int)
+bsreadln: int (bstring, struct bStream *, char)
+bsreadlna: int (bstring, struct bStream *, char)
+bsreadlns: int (bstring, struct bStream *, const_bstring)
+bsreadlnsa: int (bstring, struct bStream *, const_bstring)
+bssplitscb: int (struct bStream *, const_bstring, int (*)(void *, int, const_bstring), void *)
+bssplitstrcb: int (struct bStream *, const_bstring, int (*)(void *, int, const_bstring), void *)
+bstr2cstr: char *(const_bstring, char)
+bstrchrp: int (const_bstring, int, int)
+bstrcmp: int (const_bstring, const_bstring)
+bstrcpy: bstring (const_bstring)
+bstricmp: int (const_bstring, const_bstring)
+bstrListAlloc: int (struct bstrList *, int)
+bstrListAllocMin: int (struct bstrList *, int)
+bstrListCreate: struct bstrList *(void)
+bstrListCreateMin: struct bstrList *(int)
+bstrListDestroy: int (struct bstrList *)
+bstrListPop: bstring (struct bstrList *)
+bstrListPush: int (struct bstrList *, bstring)
+bstrncmp: int (const_bstring, const_bstring, int)
+bstrnicmp: int (const_bstring, const_bstring, int)
+bstrrchrp: int (const_bstring, int, int)
+bsunread: int (struct bStream *, const_bstring)
+btolower: int (bstring)
+btoupper: int (bstring)
+btrimws: int (bstring)
+btrunc: int (bstring, int)
+bunrefcstr: int (bstring)
+bvcformata: int (bstring, int, const char *, struct __va_list_tag *)
+charset_decompose: size_t (charset_t, char *, size_t, char *, size_t)
+charset_mac_centraleurope: {name = "MAC_CENTRALEUROPE", kTextEncoding = 29, pull = <mac_centraleurope_pull>, push = <mac_centraleurope_push>, flags = 17, iname = 0x0, prev = 0x0, next = 0x0}
+charset_mac_chinese_simp: {name = "MAC_CHINESE_SIMP", kTextEncoding = 25, pull = <mac_chinese_simp_pull>, push = <mac_chinese_simp_push>, flags = 85, iname = "EUC-CN", prev = 0x0, next = 0x0}
+charset_mac_chinese_trad: {name = "MAC_CHINESE_TRAD", kTextEncoding = 2, pull = <mac_chinese_trad_pull>, push = <mac_chinese_trad_push>, flags = 85, iname = "BIG-5", prev = 0x0, next = 0x0}
+charset_mac_cyrillic: {name = "MAC_CYRILLIC", kTextEncoding = 7, pull = <mac_cyrillic_pull>, push = <mac_cyrillic_push>, flags = 17, iname = 0x0, prev = 0x0, next = 0x0}
+charset_mac_greek: {name = "MAC_GREEK", kTextEncoding = 6, pull = <mac_greek_pull>, push = <mac_greek_push>, flags = 17, iname = 0x0, prev = 0x0, next = 0x0}
+charset_mac_hebrew: {name = "MAC_HEBREW", kTextEncoding = 5, pull = <mac_hebrew_pull>, push = <mac_hebrew_push>, flags = 17, iname = 0x0, prev = 0x0, next = 0x0}
+charset_mac_japanese: {name = "MAC_JAPANESE", kTextEncoding = 1, pull = <mac_japanese_pull>, push = <mac_japanese_push>, flags = 85, iname = "SHIFT_JIS", prev = 0x0, next = 0x0}
+charset_mac_korean: {name = "MAC_KOREAN", kTextEncoding = 3, pull = <mac_korean_pull>, push = <mac_korean_push>, flags = 85, iname = "EUC-KR", prev = 0x0, next = 0x0}
+charset_mac_roman: {name = "MAC_ROMAN", kTextEncoding = 0, pull = <mac_roman_pull>, push = <mac_roman_push>, flags = 21, iname = 0x0, prev = 0x0, next = 0x0}
+charset_mac_turkish: {name = "MAC_TURKISH", kTextEncoding = 35, pull = <mac_turkish_pull>, push = <mac_turkish_push>, flags = 17, iname = 0x0, prev = 0x0, next = 0x0}
+charset_precompose: size_t (charset_t, char *, size_t, char *, size_t)
+charset_strlower: size_t (charset_t, const char *, size_t, char *, size_t)
+charset_strupper: size_t (charset_t, const char *, size_t, char *, size_t)
+charset_to_ucs2_allocate: size_t (charset_t, uint16_t **, const char *)
+charset_to_utf8_allocate: size_t (charset_t, char **, const char *)
+charset_utf8: {name = "UTF8", kTextEncoding = 134217987, pull = <utf8_pull>, push = <utf8_push>, flags = 22, iname = 0x0, prev = 0x0, next = 0x0}
+charset_utf8_mac: {name = "UTF8-MAC", kTextEncoding = 134217987, pull = <utf8_pull>, push = <utf8_push>, flags = 27, iname = 0x0, prev = 0x0, next = 0x0}
+check_lockfile: int (const char *, const char *)
+cjk_char_pull: size_t (uint16_t, uint16_t *, const uint32_t *)
+cjk_char_push: size_t (uint16_t, uint8_t *)
+cjk_compose: uint16_t (uint16_t, uint16_t, const uint32_t *, size_t)
+cjk_compose_seq: uint16_t (const uint16_t *, size_t *, const uint32_t *, size_t)
+cjk_generic_pull: size_t (size_t (*)(uint16_t *, const uint8_t *, size_t *), void *, char **, size_t *, char **, size_t *)
+cjk_generic_push: size_t (size_t (*)(uint8_t *, const uint16_t *, size_t *), void *, char **, size_t *, char **, size_t *)
+cjk_lookup: uint16_t (uint16_t, const cjk_index_t *, const uint16_t *)
+cnid_add: cnid_t (struct _cnid_db *, const struct stat *, const cnid_t, const char *, const size_t, cnid_t)
+cnid_close: void (struct _cnid_db *)
+cnid_dbd_add: cnid_t (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t, cnid_t)
+cnid_dbd_close: void (struct _cnid_db *)
+cnid_dbd_delete: int (struct _cnid_db *, const cnid_t)
+cnid_dbd_find: int (struct _cnid_db *, const char *, size_t, void *, size_t)
+cnid_dbd_get: cnid_t (struct _cnid_db *, cnid_t, const char *, size_t)
+cnid_dbd_getstamp: int (struct _cnid_db *, void *, const size_t)
+cnid_dbd_lookup: cnid_t (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t)
+cnid_dbd_module: {name = "dbd", db_list = {next = 0x0, prev = 0x0}, cnid_open = 0, flags = 0}
+cnid_dbd_open: struct _cnid_db *(struct cnid_open_args *)
+cnid_dbd_rebuild_add: cnid_t (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t, cnid_t)
+cnid_dbd_resolve: char *(struct _cnid_db *, cnid_t *, void *, size_t)
+cnid_dbd_update: int (struct _cnid_db *, cnid_t, const struct stat *, cnid_t, const char *, size_t)
+cnid_delete: int (struct _cnid_db *, cnid_t)
+cnid_find: int (struct _cnid_db *, const char *, size_t, void *, size_t)
+cnid_get: cnid_t (struct _cnid_db *, const cnid_t, char *, const size_t)
+cnid_getstamp: int (struct _cnid_db *, void *, const size_t)
+cnid_init: void (void)
+cnid_last_add: cnid_t (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t, cnid_t)
+cnid_last_close: void (struct _cnid_db *)
+cnid_last_delete: int (struct _cnid_db *, const cnid_t)
+cnid_last_get: cnid_t (struct _cnid_db *, cnid_t, const char *, size_t)
+cnid_last_lookup: cnid_t (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t)
+cnid_last_module: {name = "last", db_list = {next = 0x0, prev = 0x0}, cnid_open = 0, flags = 0}
+cnid_last_open: struct _cnid_db *(struct cnid_open_args *)
+cnid_last_resolve: char *(struct _cnid_db *, cnid_t *, void *, size_t)
+cnid_last_update: int (struct _cnid_db *, cnid_t, const struct stat *, cnid_t, const char *, size_t)
+cnid_lookup: cnid_t (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t)
+cnid_open: struct _cnid_db *(const char *, mode_t, char *, int, const char *, const char *)
+cnid_rebuild_add: cnid_t (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t, cnid_t)
+cnid_register: void (struct _cnid_module *)
+cnid_resolve: char *(struct _cnid_db *, cnid_t *, void *, size_t)
+cnid_tdb_add: cnid_t (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t, cnid_t)
+cnid_tdb_close: void (struct _cnid_db *)
+cnid_tdb_delete: int (struct _cnid_db *, const cnid_t)
+cnid_tdb_get: cnid_t (struct _cnid_db *, cnid_t, const char *, size_t)
+cnid_tdb_lookup: cnid_t (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t)
+cnid_tdb_module: {name = "tdb", db_list = {next = 0x0, prev = 0x0}, cnid_open = 0, flags = 12}
+cnid_tdb_open: struct _cnid_db *(struct cnid_open_args *)
+cnid_tdb_resolve: char *(struct _cnid_db *, cnid_t *, void *, size_t)
+cnid_tdb_update: int (struct _cnid_db *, cnid_t, const struct stat *, cnid_t, const char *, size_t)
+cnid_update: int (struct _cnid_db *, const cnid_t, const struct stat *, const cnid_t, char *, const size_t)
+compare_ip: int (const struct sockaddr *, const struct sockaddr *)
+convert_charset: size_t (charset_t, charset_t, charset_t, const char *, size_t, char *, size_t, uint16_t *)
+convert_string: size_t (charset_t, charset_t, const void *, size_t, void *, size_t)
+convert_string_allocate: size_t (charset_t, charset_t, const void *, size_t, char **)
+copy_ea: int (const char *, int, const char *, const char *, mode_t)
+copy_file: int (int, const char *, const char *, mode_t)
+copy_file_fd: int (int, int)
+copy_fork: int (int, struct adouble *, struct adouble *)
+create_lockfile: int (const char *, const char *)
+daemonize: int (int, int)
+decompose_w: size_t (uint16_t *, size_t, uint16_t *, size_t *)
+deny_severity: 3
+dequeue: void *(q_t *)
+_diacasemap: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 231, 203, 229, 128, 204, 129, 130, 131, 233, 230, 232, 234, 237, 235, 236, 132, 238, 241, 239, 133, 205, 242, 244, 243, 134, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 198, 183, 184, 184, 186, 187, 188, 189, 174, 175, 192, 193, 194, 195, 196, 197, 198, 199...}
+_dialowermap: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 138, 140, 141, 142, 150, 154, 159, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 132, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 190, 191, 176, 177, 178, 179, 180, 181, 198, 183, 185, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199...}
+dictionary_del: void (dictionary *)
+dictionary_dump: void (dictionary *, FILE *)
+dictionary_get: const char *(const dictionary *, const char *, const char *, const char *)
+dictionary_hash: unsigned int (char *)
+dictionary_new: dictionary *(int)
+dictionary_set: int (dictionary *, char *, char *, char *)
+dictionary_unset: void (dictionary *, char *, char *)
+dir_rx_set: int (mode_t)
+dsi_attention: int (DSI *, AFPUserBytes)
+dsi_close: void (DSI *)
+dsi_cmdreply: int (DSI *, const int)
+dsi_disconnect: int (DSI *)
+dsi_getsession: int (DSI *, server_child *, int, afp_child_t **)
+dsi_getstatus: void (DSI *)
+dsi_init: DSI *(AFPObj *, const char *, const char *, const char *)
+dsi_opensession: void (DSI *)
+dsi_read: ssize_t (DSI *, void *, const size_t)
+dsi_readdone: void (DSI *)
+dsi_readinit: ssize_t (DSI *, void *, const size_t, const size_t, const int)
+dsi_stream_read: size_t (DSI *, void *, const size_t)
+dsi_stream_read_file: ssize_t (DSI *, const int, off_t, const size_t, const int)
+dsi_stream_receive: int (DSI *)
+dsi_stream_send: int (DSI *, void *, size_t)
+dsi_stream_write: ssize_t (DSI *, void *, const size_t, int)
+dsi_tcp_init: int (DSI *, const char *, const char *, const char *)
+dsi_tickle: int (DSI *)
+dsi_write: size_t (DSI *, void *, const size_t)
+dsi_writeflush: void (DSI *)
+dsi_writeinit: size_t (DSI *, void *, const size_t)
+ea_chmod_dir: int (const struct vol *, const char *, mode_t, struct stat *)
+ea_chmod_file: int (const struct vol *, const char *, mode_t, struct stat *)
+ea_chown: int (const struct vol *, const char *, uid_t, gid_t)
+ea_close: int (struct ea *)
+ea_copyfile: int (const struct vol *, int, const char *, const char *)
+ea_deletefile: int (const struct vol *, int, const char *)
+ea_open: int (const struct vol *, const char *, eaflags_t, struct ea *)
+ea_openat: int (const struct vol *, int, const char *, eaflags_t, struct ea *)
+ea_path: char *(const struct ea *, const char *, int)
+ea_renamefile: int (const struct vol *, int, const char *, const char *)
+enqueue: qnode_t *(q_t *, void *)
+fault_setup: void (void (*)(void *))
+fdset_add_fd: void (int, struct pollfd **, struct polldata **, int *, int *, int, enum fdtype, void *)
+fdset_del_fd: void (struct pollfd **, struct polldata **, int *, int *, int)
+find_charset_functions: struct charset_functions *(const char *)
+_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 *)
+getnamefromuuid: int (const uuidp_t, char **, uuidtype_t *)
+getuuidfromname: int (const char *, uuidtype_t, unsigned char *)
+getvolbyname: struct vol *(const char *)
+getvolbypath: struct vol *(AFPObj *, const char *)
+getvolbyvid: struct vol *(const uint16_t)
+getvolumes: struct vol *(void)
+gmem: int (gid_t, int, gid_t *)
+iniparser_dump: void (const dictionary *, FILE *)
+iniparser_dump_ini: void (const dictionary *, FILE *)
+iniparser_find_entry: int (const dictionary *, const char *)
+iniparser_freedict: void (dictionary *)
+iniparser_getboolean: int (const dictionary *, const char *, const char *, int)
+iniparser_getdouble: double (const dictionary *, const char *, const char *, double)
+iniparser_getint: int (const dictionary *, const char *, const char *, int)
+iniparser_getnsec: int (const dictionary *)
+iniparser_getsecname: const char *(const dictionary *, int)
+iniparser_getstrdup: char *(const dictionary *, const char *, const char *, const char *)
+iniparser_getstring: const char *(const dictionary *, const char *, const char *, const char *)
+iniparser_load: dictionary *(const char *)
+iniparser_set: int (dictionary *, char *, char *, char *)
+iniparser_unset: void (dictionary *, char *, char *)
+_init: <text variable, no debug info>
+init_iconv: void (void)
+initline: void (int, char *)
+initvol_vfs: void (struct vol *)
+ipc_child_write: int (int, uint16_t, int, void *)
+ipc_client_uds: int (const char *)
+ipc_server_read: int (server_child *, int)
+ipc_server_uds: int (const char *)
+islower_sp: int (uint32_t)
+islower_w: int (uint16_t)
+isupper_sp: int (uint32_t)
+isupper_w: int (uint16_t)
+lchdir: int (const char *)
+ldap_auth_dn: 0x0
+ldap_auth_method: 0
+ldap_auth_pw: 0x0
+ldap_config_valid: 0
+ldap_getnamefromuuid: int (const char *, char **, uuidtype_t *)
+ldap_getuuidfromname: int (const char *, uuidtype_t, char **)
+ldap_group_attr: 0x0
+ldap_groupbase: 0x0
+ldap_groupscope: 0
+ldap_name_attr: 0x0
+ldap_prefs: {{pref = 0x0, name = "ldap server", strorint = 0, intfromarray = 0, valid = -1}, {pref = 0x0, name = "ldap auth method", strorint = 1, intfromarray = 1, valid = -1}, {pref = 0x0, name = "ldap auth dn", strorint = 0, intfromarray = 0, valid = 0}, {pref = 0x0, name = "ldap auth pw", strorint = 0, intfromarray = 0, valid = 0}, {pref = 0x0, name = "ldap userbase", strorint = 0, intfromarray = 0, valid = -1}, {pref = 0x0, name = "ldap userscope", strorint = 1, intfromarray = 1, valid = -1}, {pref = 0x0, name = "ldap groupbase", strorint = 0, intfromarray = 0, valid = -1}, {pref = 0x0, name = "ldap groupscope", strorint = 1, intfromarray = 1, valid = -1}, {pref = 0x0, name = "ldap uuid attr", strorint = 0, intfromarray = 0, valid = -1}, {pref = 0x0, name = "ldap uuid string", strorint = 0, intfromarray = 0, valid = 0}, {pref = 0x0, name = "ldap name attr", strorint = 0, intfromarray = 0, valid = -1}, {pref = 0x0, name = "ldap group attr", strorint = 0, intfromarray = 0, valid = -1}, {pref = 0x0, name = "ldap uid attr", strorint = 0, intfromarray = 0, valid = 0}, {pref = 0x0, name = "ldap uuid encoding", strorint = 1, intfromarray = 1, valid = 0}, {pref = 0x0, name = 0x0, strorint = 0, intfromarray = 0, valid = -1}}
+ldap_server: 0x0
+ldap_uid_attr: 0x0
+ldap_userbase: 0x0
+ldap_userscope: 0
+ldap_uuid_attr: 0x0
+ldap_uuid_encoding: 0
+ldap_uuid_string: 0x0
+list_eas: int (const struct vol *, char *, size_t *, const char *, int)
+load_charset: int (struct vol *)
+load_volumes: int (AFPObj *, void (*)(const AFPObj *, struct vol *))
+localuuid_from_id: void (unsigned char *, uuidtype_t, unsigned int)
+lock_reg: int (int, int, int, off_t, int, off_t)
+log_config: {inited = false, syslog_opened = false, console = false, processname = '\0' <repeats 15 times>, syslog_facility = 0, syslog_display_options = 0}
+lstatat: int (int, const char *, struct stat *)
+make_log_entry: void (enum loglevels, enum logtypes, const char *, int, char *, ...)
+make_tdb_data: unsigned char *(uint32_t, const struct stat *, const cnid_t, const char *, const size_t)
+mb_generic_pull: size_t (int (*)(uint16_t *, const unsigned char *), void *, char **, size_t *, char **, size_t *)
+mb_generic_push: size_t (int (*)(unsigned char *, uint16_t), void *, char **, size_t *, char **, size_t *)
+netatalk_panic: void (const char *)
+netatalk_rmdir: int (int, const char *)
+netatalk_rmdir_all_errors: int (int, const char *)
+netatalk_unlink: int (const char *)
+netatalk_unlinkat: int (int, const char *)
+nftw: int (const char *, nftw_func_t, dir_notification_func_t, int, int)
+opendirat: DIR *(int, const char *)
+openflags2logstr: const char *(int)
+parseline: int (int, char *)
+posix_chmod: int (const char *, mode_t)
+posix_fchmod: int (int, mode_t)
+precompose_w: size_t (uint16_t *, size_t, uint16_t *, size_t *)
+prefs_array: {{pref = "ldap auth method", valuestring = "none", value = 0}, {pref = "ldap auth method", valuestring = "simple", value = 128}, {pref = "ldap auth method", valuestring = "sasl", value = 163}, {pref = "ldap userscope", valuestring = "base", value = 0}, {pref = "ldap userscope", valuestring = "one", value = 1}, {pref = "ldap userscope", valuestring = "sub", value = 2}, {pref = "ldap groupscope", valuestring = "base", value = 0}, {pref = "ldap groupscope", valuestring = "one", value = 1}, {pref = "ldap groupscope", valuestring = "sub", value = 2}, {pref = "ldap uuid encoding", valuestring = "ms-guid", value = 1}, {pref = "ldap uuid encoding", valuestring = "string", value = 0}, {pref = 0x0, valuestring = 0x0, value = 0}}
+prequeue: qnode_t *(q_t *, void *)
+queue_destroy: void (q_t *, void (*)(void *))
+queue_init: q_t *(void)
+randombytes: void (void *, int)
+readt: ssize_t (int, void *, const size_t, int, int)
+realpath_safe: char *(const char *)
+reconnect_ipc: int (AFPObj *)
+recv_fd: int (int, int)
+rel_path_in_vol: bstring (const char *, const char *)
+remove_acl_vfs: int (const char *)
+remove_ea: int (const struct vol *, const char *, const char *, int)
+run_cmd: int (const char *, char **)
+search_cachebyname: int (const char *, uuidtype_t *, unsigned char *)
+search_cachebyuuid: int (uuidp_t, char **, uuidtype_t *)
+send_fd: int (int, int)
+server_child_add: afp_child_t *(server_child *, int, pid_t, int)
+server_child_alloc: server_child *(const int, const int)
+server_child_free: void (server_child *)
+server_child_kill: void (server_child *, int, int)
+server_child_kill_one_by_id: void (server_child *, int, pid_t, uid_t, uint32_t, char *, uint32_t)
+server_child_remove: int (server_child *, const int, pid_t)
+server_child_setup: void (server_child *, const int, void (*)(const pid_t))
+server_child_transfer_session: int (server_child *, int, pid_t, uid_t, int, uint16_t)
+server_lock: pid_t (char *, char *, int)
+server_reset_signal: void (void)
+set_charset_name: int (charset_t, const char *)
+set_ea: int (const struct vol *, const char *, const char *, const char *, size_t, int)
+setfilmode: int (const char *, mode_t, struct stat *, mode_t)
+setnonblock: int (int, int)
+set_processname: void (const char *)
+setuplog: void (const char *, const char *)
+statat: int (int, const char *, struct stat *)
+strcasechr_sp: uint16_t *(const uint16_t *, uint32_t)
+strcasechr_w: uint16_t *(const uint16_t *, uint16_t)
+strcasecmp_w: int (const uint16_t *, const uint16_t *)
+strcasestr_w: uint16_t *(const uint16_t *, const uint16_t *)
+strcat_w: uint16_t *(uint16_t *, const uint16_t *)
+strchr_w: uint16_t *(const uint16_t *, uint16_t)
+strcmp_w: int (const uint16_t *, const uint16_t *)
+strdiacasecmp: int (const char *, const char *)
+strdup_w: uint16_t *(const uint16_t *)
+stripped_slashes_basename: char *(char *)
+strlcat: size_t (char *, const char *, size_t)
+strlcpy: size_t (char *, const char *, size_t)
+strlen_w: size_t (const uint16_t *)
+strlower_w: int (uint16_t *)
+strncasecmp_w: int (const uint16_t *, const uint16_t *, size_t)
+strncat_w: uint16_t *(uint16_t *, const uint16_t *, const size_t)
+strncmp_w: int (const uint16_t *, const uint16_t *, size_t)
+strncpy_w: uint16_t *(uint16_t *, const uint16_t *, const size_t)
+strndiacasecmp: int (const char *, const char *, size_t)
+strndup_w: uint16_t *(const uint16_t *, size_t)
+strnlen_w: size_t (const uint16_t *, size_t)
+strstr_w: uint16_t *(const uint16_t *, const uint16_t *)
+strupper_w: int (uint16_t *)
+sys_ea_copyfile: int (const struct vol *, int, const char *, const char *)
+sys_fgetxattr: ssize_t (int, const char *, void *, size_t)
+sys_fsetxattr: int (int, const char *, const void *, size_t, int)
+sys_ftruncate: int (int, off_t)
+sys_get_eacontent: int (const struct vol *, char *, size_t *, const char *, int, const char *, int)
+sys_get_easize: int (const struct vol *, char *, size_t *, const char *, int, const char *)
+sys_getxattr: ssize_t (const char *, const char *, void *, size_t)
+sys_getxattrfd: int (int, const char *, int, ...)
+sys_lgetxattr: ssize_t (const char *, const char *, void *, size_t)
+sys_list_eas: int (const struct vol *, char *, size_t *, const char *, int)
+sys_listxattr: ssize_t (const char *, char *, size_t)
+sys_llistxattr: ssize_t (const char *, char *, size_t)
+sys_lremovexattr: int (const char *, const char *)
+sys_lsetxattr: int (const char *, const char *, const void *, size_t, int)
+sys_remove_ea: int (const struct vol *, const char *, const char *, int)
+sys_removexattr: int (const char *, const char *)
+sys_sendfile: ssize_t (int, int, off_t *, size_t)
+sys_set_ea: int (const struct vol *, const char *, const char *, const char *, size_t, int)
+sys_setxattr: int (const char *, const char *, const void *, size_t, int)
+tdb_add_flags: void (struct tdb_context *, unsigned int)
+tdb_allocate: tdb_off_t (struct tdb_context *, tdb_len_t, struct tdb_record *)
+tdb_alloc_read: unsigned char *(struct tdb_context *, tdb_off_t, tdb_len_t)
+tdb_append: int (struct tdb_context *, TDB_DATA, TDB_DATA)
+tdb_brlock: int (struct tdb_context *, tdb_off_t, int, int, int, size_t)
+tdb_brlock_upgrade: int (struct tdb_context *, tdb_off_t, size_t)
+tdb_chainlock: int (struct tdb_context *, TDB_DATA)
+tdb_chainlock_mark: int (struct tdb_context *, TDB_DATA)
+tdb_chainlock_nonblock: int (struct tdb_context *, TDB_DATA)
+tdb_chainlock_read: int (struct tdb_context *, TDB_DATA)
+tdb_chainlock_unmark: int (struct tdb_context *, TDB_DATA)
+tdb_chainunlock: int (struct tdb_context *, TDB_DATA)
+tdb_chainunlock_read: int (struct tdb_context *, TDB_DATA)
+tdb_check: int (struct tdb_context *, int (*)(TDB_DATA, TDB_DATA, void *), void *)
+tdb_close: int (struct tdb_context *)
+tdb_convert: void *(void *, uint32_t)
+tdb_delete: int (struct tdb_context *, TDB_DATA)
+tdb_do_delete: int (struct tdb_context *, tdb_off_t, struct tdb_record *)
+tdb_dump_all: void (struct tdb_context *)
+tdb_enable_seqnum: void (struct tdb_context *)
+tdb_error: enum TDB_ERROR (struct tdb_context *)
+tdb_errorstr: const char *(struct tdb_context *)
+tdb_exists: int (struct tdb_context *, TDB_DATA)
+tdb_expand: int (struct tdb_context *, tdb_off_t)
+tdb_fd: int (struct tdb_context *)
+tdb_fetch: TDB_DATA (struct tdb_context *, TDB_DATA)
+tdb_find_lock_hash: tdb_off_t (struct tdb_context *, TDB_DATA, uint32_t, int, struct tdb_record *)
+tdb_firstkey: TDB_DATA (struct tdb_context *)
+tdb_free: int (struct tdb_context *, tdb_off_t, struct tdb_record *)
+tdb_freelist_size: int (struct tdb_context *)
+tdb_get_flags: int (struct tdb_context *)
+tdb_get_logging_private: void *(struct tdb_context *)
+tdb_get_seqnum: int (struct tdb_context *)
+tdb_hash_size: int (struct tdb_context *)
+tdb_increment_seqnum_nonblock: void (struct tdb_context *)
+tdb_io_init: void (struct tdb_context *)
+tdb_lock: int (struct tdb_context *, int, int)
+tdb_lockall: int (struct tdb_context *)
+tdb_lockall_mark: int (struct tdb_context *)
+tdb_lockall_nonblock: int (struct tdb_context *)
+tdb_lockall_read: int (struct tdb_context *)
+tdb_lockall_read_nonblock: int (struct tdb_context *)
+tdb_lockall_unmark: int (struct tdb_context *)
+tdb_lock_nonblock: int (struct tdb_context *, int, int)
+tdb_lock_record: int (struct tdb_context *, tdb_off_t)
+tdb_log_fn: tdb_log_func (struct tdb_context *)
+tdb_map_size: size_t (struct tdb_context *)
+tdb_mmap: void (struct tdb_context *)
+tdb_munmap: int (struct tdb_context *)
+tdb_name: const char *(struct tdb_context *)
+tdb_nextkey: TDB_DATA (struct tdb_context *, TDB_DATA)
+tdb_null: {dptr = 0x0, dsize = 0}
+tdb_ofs_read: int (struct tdb_context *, tdb_off_t, tdb_off_t *)
+tdb_ofs_write: int (struct tdb_context *, tdb_off_t, tdb_off_t *)
+tdb_open: struct tdb_context *(const char *, int, int, int, mode_t)
+tdb_open_ex: struct tdb_context *(const char *, int, int, int, mode_t, const struct tdb_logging_context *, tdb_hash_func)
+tdb_parse_data: int (struct tdb_context *, TDB_DATA, tdb_off_t, tdb_len_t, int (*)(TDB_DATA, TDB_DATA, void *), void *)
+tdb_parse_record: int (struct tdb_context *, TDB_DATA, int (*)(TDB_DATA, TDB_DATA, void *), void *)
+tdb_printfreelist: int (struct tdb_context *)
+tdb_rec_free_read: int (struct tdb_context *, tdb_off_t, struct tdb_record *)
+tdb_rec_read: int (struct tdb_context *, tdb_off_t, struct tdb_record *)
+tdb_rec_write: int (struct tdb_context *, tdb_off_t, struct tdb_record *)
+tdb_remove_flags: void (struct tdb_context *, unsigned int)
+tdb_reopen: int (struct tdb_context *)
+tdb_reopen_all: int (int)
+tdb_repack: int (struct tdb_context *)
+tdb_setalarm_sigptr: void (struct tdb_context *, volatile sig_atomic_t *)
+tdb_set_logging_function: void (struct tdb_context *, const struct tdb_logging_context *)
+tdb_set_max_dead: void (struct tdb_context *, int)
+tdb_store: int (struct tdb_context *, TDB_DATA, TDB_DATA, int)
+_tdb_transaction_cancel: int (struct tdb_context *)
+tdb_transaction_cancel: int (struct tdb_context *)
+tdb_transaction_commit: int (struct tdb_context *)
+tdb_transaction_lock: int (struct tdb_context *, int)
+tdb_transaction_prepare_commit: int (struct tdb_context *)
+tdb_transaction_recover: int (struct tdb_context *)
+tdb_transaction_start: int (struct tdb_context *)
+tdb_transaction_unlock: int (struct tdb_context *)
+tdb_traverse: int (struct tdb_context *, tdb_traverse_func, void *)
+tdb_traverse_read: int (struct tdb_context *, tdb_traverse_func, void *)
+tdb_unlock: int (struct tdb_context *, int, int)
+tdb_unlockall: int (struct tdb_context *)
+tdb_unlockall_read: int (struct tdb_context *)
+tdb_unlock_record: int (struct tdb_context *, tdb_off_t)
+tdb_validate_freelist: int (struct tdb_context *, int *)
+tdb_wipe_all: int (struct tdb_context *)
+tdb_write_lock_record: int (struct tdb_context *, tdb_off_t)
+tdb_write_unlock_record: int (struct tdb_context *, tdb_off_t)
+tolower_sp: uint32_t (uint32_t)
+tolower_w: uint16_t (uint16_t)
+toupper_sp: uint32_t (uint32_t)
+toupper_w: uint16_t (uint16_t)
+type_configs: {{set = false, syslog = false, fd = -1, level = log_none, display_options = 0}, {set = false, syslog = false, fd = -1, level = log_none, display_options = 0}, {set = false, syslog = false, fd = -1, level = log_none, display_options = 0}, {set = false, syslog = false, fd = -1, level = log_none, display_options = 0}, {set = false, syslog = false, fd = -1, level = log_none, display_options = 0}, {set = false, syslog = false, fd = -1, level = log_none, display_options = 0}, {set = false, syslog = false, fd = -1, level = log_none, display_options = 0}, {set = false, syslog = false, fd = -1, level = log_none, display_options = 0}}
+ucs2_to_charset: size_t (charset_t, const uint16_t *, char *, size_t)
+ucs2_to_charset_allocate: size_t (charset_t, char **, const uint16_t *)
+unbecome_root: void (void)
+unix_rename: int (int, const char *, int, const char *)
+unix_strlower: size_t (const char *, size_t, char *, size_t)
+unix_strupper: size_t (const char *, size_t, char *, size_t)
+unload_volumes: void (AFPObj *)
+utf8_charlen: size_t (char *)
+utf8_decompose: size_t (char *, size_t, char *, size_t)
+utf8_precompose: size_t (char *, size_t, char *, size_t)
+utf8_strlen_validate: size_t (char *)
+utf8_strlower: size_t (const char *, size_t, char *, size_t)
+utf8_strupper: size_t (const char *, size_t, char *, size_t)
+utf8_to_charset_allocate: size_t (charset_t, char **, const char *)
+uuid_bin2string: const char *(const unsigned char *)
+uuidcache_dump: void (void)
+uuid_string2bin: void (const char *, unsigned char *)
+uuidtype: {"", "USER", "GROUP", "LOCAL"}
+volume_free: void (struct vol *)
+volume_unlink: void (struct vol *)
+writet: ssize_t (int, void *, const size_t, int, int)
return 0;
}
+void free_charset_names(void)
+{
+ for (int ch = 0; ch < MAX_CHARSETS; ch++) {
+ if (charset_names[ch]) {
+ free(charset_names[ch]);
+ charset_names[ch] = NULL;
+ }
+ }
+}
+
static struct charset_functions* get_charset_functions (charset_t ch)
{
if (charsets[ch] != NULL)
cnid.c \
fault.c \
getiface.c \
+ gettok.c \
locking.c \
logger.c \
module.c \
--- /dev/null
+/*
+ * $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 <sys/param.h>
+#include <string.h>
+#include <ctype.h>
+#include <pwd.h>
+
+#include <atalk/globals.h>
+
+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 */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <atalk/util.h>
#include <atalk/logger.h>
-
-#define OPEN_LOGS_AS_UID 0
+#include <atalk/unix.h>
#define COUNT_ARRAY(array) (sizeof((array))/sizeof((array)[0]))
"AFPDaemon", \
"DSI", \
"UAMS", \
+ "FCE", \
+ "ad", \
"Spotlight", \
- "end_of_list_marker"} \
+ "end_of_list_marker"}
/* =========================================================================
Config
DEFAULT_LOG_CONFIG, /* logtype_afpd */
DEFAULT_LOG_CONFIG, /* logtype_dsi */
DEFAULT_LOG_CONFIG, /* logtype_uams */
+ DEFAULT_LOG_CONFIG, /* logtype_fce */
+ DEFAULT_LOG_CONFIG, /* logtype_ad */
DEFAULT_LOG_CONFIG /* logtype_sl */
};
static 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) {
free(tmp);
} else {
- process_uid = geteuid();
- if (process_uid) {
- if (seteuid(OPEN_LOGS_AS_UID) == -1) {
- process_uid = 0;
- }
- }
+ become_root();
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);
- }
- }
+ become_root();
}
/* Check for error opening/creating logfile */
* check access list
*
* this function wants something of the following form:
- * "@group,name,name2,@group2,name3" or "@group name name2 @group2 name3"
+ * "@group,name,name2,@group2,name3".
* A NULL argument allows everybody to have access.
* We return three things:
* -1: no list
*/
static int accessvol(const AFPObj *obj, const char *args, const char *name)
{
- char buf[MAXPATHLEN + 1], *p;
+ EC_INIT;
+ char *names = NULL, *p;
struct group *gr;
if (!args)
- return -1;
+ EC_EXIT_STATUS(-1);
- strlcpy(buf, args, sizeof(buf));
- if ((p = strtok(buf, ", ")) == NULL) /* nothing, return okay */
- return -1;
+ EC_NULL_LOG( names = strdup(args) );
+
+ if ((p = strtok(names, ",")) == NULL) /* nothing, return okay */
+ EC_EXIT_STATUS(-1);
while (p) {
if (*p == '@') { /* it's a group */
if ((gr = getgrnam(p + 1)) && gmem(gr->gr_gid, obj->ngroups, obj->groups))
- return 1;
+ EC_EXIT_STATUS(1);
} else if (strcasecmp(p, name) == 0) /* it's a user name */
- return 1;
+ EC_EXIT_STATUS(1);
p = strtok(NULL, ", ");
}
- return 0;
+EC_CLEANUP:
+ if (names)
+ free(names);
+ EC_EXIT;
}
static int hostaccessvol(const AFPObj *obj, const char *volname, const char *args)
* @param pwd (r) struct passwd of logged in user, may be NULL in master afpd
* @param section (r) volume name wo variables expanded (exactly as in iniconfig)
* @param name (r) volume name
- * @param path (r) volume path
+ * @param path_in (r) volume path
* @param preset (r) default preset, may be NULL
* @returns vol on success, NULL on error
*/
const struct passwd *pwd,
const char *section,
const char *name,
- const char *path,
+ const char *path_in,
const char *preset)
{
EC_INIT;
struct vol *volume = NULL;
int i, suffixlen, vlen, tmpvlen, u8mvlen, macvlen;
- char *tmpname;
+ char tmpname[AFPVOL_U8MNAMELEN+1];
+ char path[MAXPATHLEN + 1];
ucs2_t u8mtmpname[(AFPVOL_U8MNAMELEN+1)*2], mactmpname[(AFPVOL_MACNAMELEN+1)*2];
char suffix[6]; /* max is #FFFF */
uint16_t flags;
const char *val;
char *p, *q;
+ strlcpy(path, path_in, MAXPATHLEN);
+
LOG(log_debug, logtype_afpd, "createvol(volume: '%s', path: \"%s\", preset: '%s'): BEGIN",
name, path, preset ? preset : "-");
if ( name == NULL || *name == '\0' ) {
- if ((name = strrchr( path, '/' )) == NULL) {
+ if ((name = strrchr( path, '/' )) == NULL)
EC_FAIL;
- }
-
/* if you wish to share /, you need to specify a name. */
if (*++name == '\0')
EC_FAIL;
}
/* Once volumes are loaded, we never change options again, we just delete em when they're removed from afp.conf */
+
for (struct vol *vol = Volumes; vol; vol = vol->v_next) {
- if (STRCMP(path, ==, vol->v_path)) {
- LOG(log_debug, logtype_afpd, "createvol('%s'): already loaded", name);
+ if (STRCMP(name, ==, vol->v_localname) && vol->v_deleted) {
+ /*
+ * reloading config, volume still present, nothing else to do,
+ * we don't change options for volumes once they're loaded
+ */
vol->v_deleted = 0;
volume = vol;
- goto EC_CLEANUP;
+ EC_EXIT_STATUS(0);
+ }
+ if (STRCMP(path, ==, vol->v_path)) {
+ LOG(log_note, logtype_afpd, "volume \"%s\" path \"%s\" is the same as volumes \"%s\" path",
+ name, path, vol->v_configname);
+ EC_EXIT_STATUS(0);
}
+ /*
+ * We could check for nested volume paths here, but
+ * nobody was able to come up with an implementation yet,
+ * that is simple, fast and correct.
+ */
}
/*
EC_NULL( volume->v_maccodepage = strdup(obj->options.maccodepage) );
vlen = strlen(name);
- tmpname = strdup(name);
+ strlcpy(tmpname, name, sizeof(tmpname));
for(i = 0; i < vlen; i++)
if(tmpname[i] == '/') tmpname[i] = ':';
EC_NULL( volume->v_localname = strdup(name) );
EC_NULL( volume->v_u8mname = strdup_w(u8mtmpname) );
EC_NULL( volume->v_macname = strdup_w(mactmpname) );
- EC_NULL( volume->v_path = malloc(strlen(path) + 1) );
-
+ EC_NULL( volume->v_path = strdup(path) );
+
volume->v_name = utf8_encoding(obj) ? volume->v_u8mname : volume->v_macname;
- strcpy(volume->v_path, path);
#ifdef __svr4__
volume->v_qfd = -1;
EC_CLEANUP:
LOG(log_debug, logtype_afpd, "createvol: END: %d", ret);
if (ret != 0) {
- if (volume) {
+ if (volume)
volume_free(volume);
- free(volume);
- }
return NULL;
}
return volume;
EC_INIT;
static int regexerr = -1;
static regex_t reg;
- char path[MAXPATHLEN + 1];
+ char *realvolpath;
char volname[AFPVOL_U8MNAMELEN + 1];
- char tmp[MAXPATHLEN + 1];
+ char path[MAXPATHLEN + 1], tmp[MAXPATHLEN + 1];
const char *preset, *default_preset, *p, *basedir;
char *q, *u;
int i;
/* no user home */
continue;
+ if ((realpath(pwent->pw_dir, tmp)) == NULL)
+ continue;
+
/* check if user home matches our "basedir regex" */
if ((basedir = iniparser_getstring(obj->iniconfig, INISEC_HOMES, "basedir regex", NULL)) == NULL) {
LOG(log_error, logtype_afpd, "\"basedir regex =\" must be defined in [Homes] section");
char errbuf[1024];
regerror(regexerr, ®, errbuf, sizeof(errbuf));
LOG(log_debug, logtype_default, "readvolfile: bad basedir regex: %s", errbuf);
+ continue;
}
- if (regexec(®, pwent->pw_dir, 1, match, 0) == REG_NOMATCH) {
- LOG(log_debug, logtype_default, "readvolfile: user home \"%s\" doesn't match basedir regex \"%s\"",
- pwent->pw_dir, basedir);
+ if (regexec(®, tmp, 1, match, 0) == REG_NOMATCH) {
+ LOG(log_error, logtype_default, "readvolfile: user home \"%s\" doesn't match basedir regex \"%s\"",
+ tmp, basedir);
continue;
}
- strlcpy(tmp, pwent->pw_dir, MAXPATHLEN);
- strlcat(tmp, "/", MAXPATHLEN);
- if (p = iniparser_getstring(obj->iniconfig, INISEC_HOMES, "path", NULL))
+ if (p = iniparser_getstring(obj->iniconfig, INISEC_HOMES, "path", NULL)) {
+ strlcat(tmp, "/", MAXPATHLEN);
strlcat(tmp, p, MAXPATHLEN);
+ }
} else {
/* Get path */
if ((p = iniparser_getstring(obj->iniconfig, secname, "path", NULL)) == NULL)
preset = iniparser_getstring(obj->iniconfig, secname, "vol preset", NULL);
- creatvol(obj, pwent, secname, volname, path, preset ? preset : default_preset ? default_preset : NULL);
+ if ((realvolpath = realpath_safe(path)) == NULL)
+ continue;
+
+ creatvol(obj, pwent, secname, volname, realvolpath, preset ? preset : default_preset ? default_preset : NULL);
+ free(realvolpath);
}
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
**************************************************************/
}
/*!
- * Free all resources allocated in a struct vol, only struct dir *v_root can't be freed
+ * Free all resources allocated in a struct vol in load_volumes()
+ *
+ * Actually opening a volume (afp_openvol()) will allocate additional
+ * ressources which are freed in closevol()
*/
void volume_free(struct vol *vol)
{
- LOG(log_debug, logtype_afpd, "volume_free('%s'): BEGIN", vol->v_localname);
-
+ free(vol->v_configname);
free(vol->v_localname);
free(vol->v_u8mname);
free(vol->v_macname);
free(vol->v_uuid);
free(vol->v_cnidserver);
free(vol->v_cnidport);
+ free(vol->v_preexec);
free(vol->v_root_preexec);
free(vol->v_postexec);
+ free(vol->v_root_postexec);
- LOG(log_debug, logtype_afpd, "volume_free: END");
+ free(vol);
}
/*!
* @param obj (r) handle
* @param delvol_fn (r) callback called for deleted volumes
*/
-int load_volumes(AFPObj *obj, void (*delvol_fn)(const AFPObj *obj, struct vol *))
+int load_volumes(AFPObj *obj)
{
EC_INIT;
int fd = -1;
EC_ZERO_LOG( readvolfile(obj, pwent) );
- for ( vol = Volumes; vol; vol = vol->v_next ) {
- if (vol->v_deleted) {
+ struct vol *p, *prevvol;
+
+ vol = Volumes;
+ prevvol = NULL;
+
+ while (vol) {
+ if (vol->v_deleted && !(vol->v_flags & AFPVOL_OPEN)) {
LOG(log_debug, logtype_afpd, "load_volumes: deleted: %s", vol->v_localname);
- if (delvol_fn)
- delvol_fn(obj, vol);
- vol = Volumes;
+ if (prevvol)
+ prevvol->v_next = vol->v_next;
+ else
+ Volumes = NULL;
+ p = vol->v_next;
+ volume_free(vol);
+ vol = p;
+ } else {
+ prevvol = vol;
+ vol = vol->v_next;
}
}
void unload_volumes(AFPObj *obj)
{
- struct vol *vol;
+ struct vol *vol, *p;
LOG(log_debug, logtype_afpd, "unload_volumes: BEGIN");
- for (vol = Volumes; vol; vol = vol->v_next)
+ p = Volumes;
+ while (p) {
+ vol = p;
+ p = vol->v_next;
volume_free(vol);
+ }
Volumes = NULL;
obj->options.volfile.mtime = 0;
const struct passwd *pw;
char volname[AFPVOL_U8MNAMELEN + 1];
char abspath[MAXPATHLEN + 1];
- char volpath[MAXPATHLEN + 1];
+ char volpath[MAXPATHLEN + 1], *realvolpath = NULL;
char tmpbuf[MAXPATHLEN + 1];
const char *secname, *basedir, *p = NULL, *subpath = NULL, *subpathconfig;
char *user = NULL, *prw;
/* (6) */
if (subpathconfig = iniparser_getstring(obj->iniconfig, INISEC_HOMES, "path", NULL)) {
+ /*
if (!subpath || strncmp(subpathconfig, subpath, strlen(subpathconfig)) != 0) {
EC_FAIL;
}
+ */
strlcat(tmpbuf, subpathconfig, MAXPATHLEN);
strlcat(tmpbuf, "/", MAXPATHLEN);
}
/* (7) */
if (volxlate(obj, volpath, sizeof(volpath) - 1, tmpbuf, pw, NULL, NULL) == NULL)
- return NULL;
+ EC_FAIL;
+ EC_NULL( realvolpath = realpath_safe(volpath) );
EC_NULL( pw = getpwnam(user) );
- LOG(log_debug, logtype_afpd, "getvolbypath(\"%s\"): user: %s, homedir: %s => volpath: \"%s\"",
- path, user, pw->pw_dir, volpath);
+ LOG(log_debug, logtype_afpd, "getvolbypath(\"%s\"): user: %s, homedir: %s => realvolpath: \"%s\"",
+ path, user, pw->pw_dir, realvolpath);
/* do variable substitution for volume name */
p = iniparser_getstring(obj->iniconfig, INISEC_HOMES, "home name", "$u's home");
if (strstr(p, "$u") == NULL)
p = "$u's home";
strlcpy(tmpbuf, p, AFPVOL_U8MNAMELEN);
- EC_NULL_LOG( volxlate(obj, volname, sizeof(volname) - 1, tmpbuf, pw, volpath, NULL) );
+ EC_NULL_LOG( volxlate(obj, volname, sizeof(volname) - 1, tmpbuf, pw, realvolpath, NULL) );
const char *preset, *default_preset;
default_preset = iniparser_getstring(obj->iniconfig, INISEC_GLOBAL, "vol preset", NULL);
preset = iniparser_getstring(obj->iniconfig, INISEC_HOMES, "vol preset", NULL);
- vol = creatvol(obj, pw, INISEC_HOMES, volname, volpath, preset ? preset : default_preset ? default_preset : NULL);
+ vol = creatvol(obj, pw, INISEC_HOMES, volname, realvolpath, preset ? preset : default_preset ? default_preset : NULL);
EC_CLEANUP:
if (user)
free(user);
+ if (realvolpath)
+ free(realvolpath);
if (ret != 0)
vol = NULL;
return vol;
/* 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 "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");
options->k5realm = iniparser_getstrdup(config, INISEC_GLOBAL, "k5 realm", NULL);
options->listen = iniparser_getstrdup(config, INISEC_GLOBAL, "afp listen", NULL);
options->ntdomain = iniparser_getstrdup(config, INISEC_GLOBAL, "nt domain", NULL);
+ options->addomain = iniparser_getstrdup(config, INISEC_GLOBAL, "ad domain", NULL);
options->ntseparator = iniparser_getstrdup(config, INISEC_GLOBAL, "nt separator", NULL);
options->mimicmodel = iniparser_getstrdup(config, INISEC_GLOBAL, "mimic model", NULL);
options->adminauthuser = iniparser_getstrdup(config, INISEC_GLOBAL, "admin auth user",NULL);
LOG(log_debug, logtype_afpd, "Locale charset is '%s'", p);
#else /* system doesn't have LOCALE support */
LOG(log_warning, logtype_afpd, "system doesn't have LOCALE support");
- p = strdup("UTF8");
+ p = "UTF8";
#endif
}
if (strcasecmp(p, "UTF-8") == 0) {
- p = strdup("UTF8");
+ p = "UTF8";
}
options->unixcodepage = strdup(p);
set_charset_name(CH_UNIX, p);
options->volcodepage = strdup(options->unixcodepage);
} else {
if (strcasecmp(p, "UTF-8") == 0) {
- p = strdup("UTF8");
+ p = "UTF8";
}
options->volcodepage = strdup(p);
}
options->maccharset = CH_MAC;
LOG(log_debug, logtype_afpd, "Global mac charset is %s", options->maccodepage);
+ if (readextmap(options->extmapfile) != 0) {
+ LOG(log_error, logtype_afpd, "Couldn't load extension -> type/creator mappings file \"%s\"",
+ options->extmapfile);
+ }
+
/* Check for sane values */
if (options->tickleval <= 0)
options->tickleval = 30;
EC_CLEANUP:
EC_EXIT;
}
+
+#define CONFIG_ARG_FREE(a) do { \
+ free(a); \
+ a = NULL; \
+ } while (0);
+
+/* get rid of any allocated afp_option buffers. */
+void afp_config_free(AFPObj *obj)
+{
+ if (obj->options.configfile)
+ CONFIG_ARG_FREE(obj->options.configfile);
+ if (obj->options.sigconffile)
+ CONFIG_ARG_FREE(obj->options.sigconffile);
+ if (obj->options.uuidconf)
+ CONFIG_ARG_FREE(obj->options.uuidconf);
+ if (obj->options.logconfig)
+ CONFIG_ARG_FREE(obj->options.logconfig);
+ if (obj->options.logfile)
+ CONFIG_ARG_FREE(obj->options.logfile);
+ if (obj->options.loginmesg)
+ CONFIG_ARG_FREE(obj->options.loginmesg);
+ if (obj->options.guest)
+ CONFIG_ARG_FREE(obj->options.guest);
+ if (obj->options.extmapfile)
+ CONFIG_ARG_FREE(obj->options.extmapfile);
+ if (obj->options.passwdfile)
+ CONFIG_ARG_FREE(obj->options.passwdfile);
+ if (obj->options.uampath)
+ CONFIG_ARG_FREE(obj->options.uampath);
+ if (obj->options.uamlist)
+ CONFIG_ARG_FREE(obj->options.uamlist);
+ if (obj->options.port)
+ CONFIG_ARG_FREE(obj->options.port);
+ if (obj->options.signatureopt)
+ CONFIG_ARG_FREE(obj->options.signatureopt);
+ if (obj->options.k5service)
+ CONFIG_ARG_FREE(obj->options.k5service);
+ if (obj->options.k5realm)
+ CONFIG_ARG_FREE(obj->options.k5realm);
+ if (obj->options.listen)
+ CONFIG_ARG_FREE(obj->options.listen);
+ if (obj->options.ntdomain)
+ CONFIG_ARG_FREE(obj->options.ntdomain);
+ if (obj->options.addomain)
+ CONFIG_ARG_FREE(obj->options.addomain);
+ if (obj->options.ntseparator)
+ CONFIG_ARG_FREE(obj->options.ntseparator);
+ if (obj->options.mimicmodel)
+ CONFIG_ARG_FREE(obj->options.mimicmodel);
+ if (obj->options.adminauthuser)
+ CONFIG_ARG_FREE(obj->options.adminauthuser);
+ if (obj->options.hostname)
+ CONFIG_ARG_FREE(obj->options.hostname);
+ if (obj->options.k5keytab)
+ CONFIG_ARG_FREE(obj->options.k5keytab);
+ if (obj->options.Cnid_srv)
+ CONFIG_ARG_FREE(obj->options.Cnid_srv);
+ if (obj->options.Cnid_port)
+ CONFIG_ARG_FREE(obj->options.Cnid_port);
+ if (obj->options.fqdn)
+ CONFIG_ARG_FREE(obj->options.fqdn);
+
+ if (obj->options.unixcodepage)
+ CONFIG_ARG_FREE(obj->options.unixcodepage);
+ if (obj->options.maccodepage)
+ CONFIG_ARG_FREE(obj->options.maccodepage);
+ if (obj->options.volcodepage)
+ CONFIG_ARG_FREE(obj->options.volcodepage);
+
+ obj->options.flags = 0;
+ obj->options.passwdbits = 0;
+
+ /* Free everything called from afp_config_parse() */
+ free_extmap();
+ iniparser_freedict(obj->iniconfig);
+ free_charset_names();
+}
#include <sys/time.h>
#include <time.h>
#include <sys/wait.h>
+#include <libgen.h>
#include <atalk/adouble.h>
#include <atalk/ea.h>
}
return( 0 );
}
+
+/*
+ * realpath() replacement that always allocates storage for returned path
+ */
+char *realpath_safe(const char *path)
+{
+ char *resolved_path;
+
+#ifdef REALPATH_TAKES_NULL
+ if ((resolved_path = realpath(path, NULL)) == NULL) {
+ LOG(log_error, logtype_afpd, "realpath() cannot resolve path \"%s\"", path);
+ return NULL;
+ }
+ return resolved_path;
+#else
+ if ((resolved_path = malloc(MAXPATHLEN+1)) == NULL)
+ return NULL;
+ if (realpath(path, resolved_path) == NULL) {
+ free(resolved_path);
+ LOG(log_error, logtype_afpd, "realpath() cannot resolve path \"%s\"", path);
+ return NULL;
+ }
+ /* Safe some memory */
+ char *tmp;
+ if ((tmp = strdup(resolved_path)) == NULL) {
+ free(resolved_path);
+ return NULL;
+ }
+ free(resolved_path);
+ resolved_path = tmp;
+ return resolved_path;
+#endif
+}
+
+/**
+ * Returns pointer to static buffer with basename of path
+ **/
+const char *basename_safe(const char *path)
+{
+ static char buf[MAXPATHLEN+1];
+ strlcpy(buf, path, MAXPATHLEN);
+ return basename(buf);
+}
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;
- }
+ become_root();
/* 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);
- }
+ unbecome_root();
return ret;
}
}
exit:
- if (seteuid(uid) < 0) {
- LOG(log_error, logtype_afpd, "can't seteuid back: %s", strerror(errno));
- exit(EXITERR_SYS);
- }
+ unbecome_root();
if ((ea_close(&ea)) != 0) {
LOG(log_error, logtype_afpd, "ea_chmod_dir('%s'): error closing ea handle", name);
EXTRA_DIST = \
afs-check.m4 \
+ ax_pthread.m4 \
cnid-backend.m4 \
config-checks.m4 \
db3-check.m4 \
summary.m4 \
tcp-wrappers.m4 \
util.m4
-
--- /dev/null
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro figures out how to build C programs using POSIX threads. It
+# sets the PTHREAD_LIBS output variable to the threads library and linker
+# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
+# flags that are needed. (The user can also force certain compiler
+# flags/libs to be tested by setting these environment variables.)
+#
+# Also sets PTHREAD_CC to any special C compiler that is needed for
+# multi-threaded programs (defaults to the value of CC otherwise). (This
+# is necessary on AIX to use the special cc_r compiler alias.)
+#
+# NOTE: You are assumed to not only compile your program with these flags,
+# but also link it with them as well. e.g. you should link with
+# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+#
+# If you are only building threads programs, you may wish to use these
+# variables in your default LIBS, CFLAGS, and CC:
+#
+# LIBS="$PTHREAD_LIBS $LIBS"
+# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+# CC="$PTHREAD_CC"
+#
+# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
+# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
+# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
+# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
+# PTHREAD_CFLAGS.
+#
+# ACTION-IF-FOUND is a list of shell commands to run if a threads library
+# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+# is not found. If ACTION-IF-FOUND is not specified, the default action
+# will define HAVE_PTHREAD.
+#
+# Please let the authors know if this macro fails on any platform, or if
+# you have any other suggestions or comments. This macro was based on work
+# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
+# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
+# Alejandro Forero Cuervo to the autoconf macro repository. We are also
+# grateful for the helpful feedback of numerous users.
+#
+# Updated for Autoconf 2.68 by Daniel Richard G.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
+# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
+#
+# 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 3 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 18
+
+AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
+AC_DEFUN([AX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_PUSH([C])
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+ AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
+ AC_MSG_RESULT($ax_pthread_ok)
+ if test x"$ax_pthread_ok" = xno; then
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+ fi
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try. Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important. Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+# other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+# doesn't hurt to check since this sometimes defines pthreads too;
+# also defines -D_REENTRANT)
+# ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case ${host_os} in
+ solaris*)
+
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+
+ ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
+ ;;
+
+ darwin*)
+ ax_pthread_flags="-pthread $ax_pthread_flags"
+ ;;
+esac
+
+if test x"$ax_pthread_ok" = xno; then
+for flag in $ax_pthread_flags; do
+
+ case $flag in
+ none)
+ AC_MSG_CHECKING([whether pthreads work without any flags])
+ ;;
+
+ -*)
+ AC_MSG_CHECKING([whether pthreads work with $flag])
+ PTHREAD_CFLAGS="$flag"
+ ;;
+
+ pthread-config)
+ AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
+ if test x"$ax_pthread_config" = xno; then continue; fi
+ PTHREAD_CFLAGS="`pthread-config --cflags`"
+ PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+ ;;
+
+ *)
+ AC_MSG_CHECKING([for the pthreads library -l$flag])
+ PTHREAD_LIBS="-l$flag"
+ ;;
+ esac
+
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Check for various functions. We must include pthread.h,
+ # since some functions may be macros. (On the Sequent, we
+ # need a special flag -Kthread to make this header compile.)
+ # We check for pthread_join because it is in -lpthread on IRIX
+ # while pthread_create is in libc. We check for pthread_attr_init
+ # due to DEC craziness with -lpthreads. We check for
+ # pthread_cleanup_push because it is one of the few pthread
+ # functions on Solaris that doesn't have a non-functional libc stub.
+ # We try pthread_create on general principles.
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
+ static void routine(void *a) { a = 0; }
+ static void *start_routine(void *a) { return a; }],
+ [pthread_t th; pthread_attr_t attr;
+ pthread_create(&th, 0, start_routine, 0);
+ pthread_join(th, 0);
+ pthread_attr_init(&attr);
+ pthread_cleanup_push(routine, 0);
+ pthread_cleanup_pop(0) /* ; */])],
+ [ax_pthread_ok=yes],
+ [])
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ AC_MSG_RESULT($ax_pthread_ok)
+ if test "x$ax_pthread_ok" = xyes; then
+ break;
+ fi
+
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ax_pthread_ok" = xyes; then
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+ AC_MSG_CHECKING([for joinable pthread attribute])
+ attr_name=unknown
+ for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
+ [int attr = $attr; return attr /* ; */])],
+ [attr_name=$attr; break],
+ [])
+ done
+ AC_MSG_RESULT($attr_name)
+ if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+ AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+ [Define to necessary symbol if this constant
+ uses a non-standard name on your system.])
+ fi
+
+ AC_MSG_CHECKING([if more special flags are required for pthreads])
+ flag=no
+ case ${host_os} in
+ aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
+ osf* | hpux*) flag="-D_REENTRANT";;
+ solaris*)
+ if test "$GCC" = "yes"; then
+ flag="-D_REENTRANT"
+ else
+ flag="-mt -D_REENTRANT"
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT(${flag})
+ if test "x$flag" != xno; then
+ PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+ fi
+
+ AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
+ ax_cv_PTHREAD_PRIO_INHERIT, [
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])],
+ [ax_cv_PTHREAD_PRIO_INHERIT=yes],
+ [ax_cv_PTHREAD_PRIO_INHERIT=no])
+ ])
+ AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
+ AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.]))
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ # More AIX lossage: must compile with xlc_r or cc_r
+ if test x"$GCC" != xyes; then
+ AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
+ else
+ PTHREAD_CC=$CC
+ fi
+else
+ PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$ax_pthread_ok" = xyes; then
+ ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+ :
+else
+ ax_pthread_ok=no
+ $2
+fi
+AC_LANG_POP
+])dnl AX_PTHREAD
dnl Whether to disable bundled libevent
AC_DEFUN([AC_NETATALK_LIBEVENT], [
- AC_MSG_CHECKING([whether to disable bundled libevent (define CPPFLAGS and LDFLAGS otherwise appropiately to pick up installed version)])
- AC_ARG_ENABLE(
- bundled-libevent,
- [AS_HELP_STRING([--disable-bundled-libevent],[whether the bundled version of libevent shall not be used (define CPPFLAGS and LDFLAGS otherwise appropiately to pick up installed version)
- ])],
- use_bundled_libevent=$enableval,
+ AC_MSG_CHECKING([whether to use bundled libevent])
+ AC_ARG_WITH(
+ libevent,
+ [AS_HELP_STRING([--with-libevent],[whether to use the bundled libevent (default: yes)])],
+ use_bundled_libevent=$withval,
use_bundled_libevent=yes
)
-
- if test x"$use_bundled_libevent" = x"yes" ; then
- AC_MSG_RESULT([no])
- AC_CONFIG_SUBDIRS([libevent])
- else
- AC_MSG_RESULT([yes])
+ AC_ARG_WITH(
+ libevent-header,
+ [AS_HELP_STRING([--with-libevent-header],[path to libevent header files])],
+ [use_bundled_libevent=no; LIBEVENT_CFLAGS=-I$withval]
+ )
+ AC_ARG_WITH(
+ libevent-lib,
+ [AS_HELP_STRING([--with-libevent-lib],[path to libevent library])],
+ [use_bundled_libevent=no; LIBEVENT_LDFLAGS=-L$withval]
+ )
+ if test x"$LIBEVENT_CFLAGS" = x"-Iyes" -o x"$LIBEVENT_LDFLAGS" = x"-Lyes" ; then
+ AC_MSG_ERROR([--with-libevent requires a path])
fi
+ AC_MSG_RESULT([$use_bundled_libevent])
+ AC_CONFIG_SUBDIRS([libevent])
+ AC_SUBST(LIBEVENT_CFLAGS)
+ AC_SUBST(LIBEVENT_LDFLAGS)
AM_CONDITIONAL(USE_BUILTIN_LIBEVENT, test x"$use_bundled_libevent" = x"yes")
])
AC_DEFUN([AC_NETATALK_CONFIG_SUMMARY], [
AC_MSG_RESULT([Configure summary:])
- AC_MSG_RESULT([ init style:])
+ AC_MSG_RESULT([ INIT STYLE:])
if test "x$init_style" != "x"; then
AC_MSG_RESULT([ $init_style])
else
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([ Samba sharemode interop: $neta_cv_have_smbshmd])
+dnl AC_MSG_RESULT([ Samba sharemode interop: $neta_cv_have_smbshmd])
AC_MSG_RESULT([ ACL support: $with_acl_support])
AC_MSG_RESULT([ Kerberos support: $with_kerberos])
AC_MSG_RESULT([ LDAP support: $netatalk_cv_ldap])
dnl # Display summary of libraries detected
AC_MSG_RESULT([Using libraries:])
- AC_MSG_RESULT([ LIBS = $LIBS])
- AC_MSG_RESULT([ CFLAGS = $CFLAGS])
+ AC_MSG_RESULT([ LIBS = $LIBS])
+ AC_MSG_RESULT([ CFLAGS = $CFLAGS])
+ AC_MSG_RESULT([ PTHREADS:])
+ AC_MSG_RESULT([ LIBS = $PTHREAD_LIBS])
+ AC_MSG_RESULT([ CFLAGS = $PTHREAD_CFLAGS])
if test x"$neta_cv_have_openssl" = x"yes"; then
AC_MSG_RESULT([ SSL:])
AC_MSG_RESULT([ LIBS = $SSL_LIBS])
AC_MSG_RESULT([ LIBS = $LDAP_LDLFLAGS $LDAP_LIBS])
AC_MSG_RESULT([ CFLAGS = $LDAP_CFLAGS])
fi
+ AC_MSG_RESULT([ LIBEVENT:])
+ if test x"$use_bundled_libevent" = x"yes"; then
+ AC_MSG_RESULT([ bundled])
+ else
+ AC_MSG_RESULT([ LIBS = $LIBEVENT_CFLAGS])
+ AC_MSG_RESULT([ CFLAGS = $LIBEVENT_LDFLAGS])
+ fi
])
.\" Title: dbd
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 12 Oct 2010
+.\" Date: 14 Sep 2012
.\" Manual: Netatalk 3.0
.\" Source: Netatalk 3.0
.\" Language: English
.\"
-.TH "DBD" "1" "12 Oct 2010" "Netatalk 3.0" "Netatalk 3.0"
+.TH "DBD" "1" "14 Sep 2012" "Netatalk 3.0" "Netatalk 3.0"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
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
+\fBdbd\fR\fB\fR [\-evx] {\-d\ [\-i] | \-s\ [\-c|\-n] | \-r\ [\-c|\-f|\-C] | \-u} \fIvolumepath\fR
.SH "DESCRIPTION"
.PP
\fBdbd\fR
.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
+Compare CNIDs in database with volume, test if \&.AppleDouble directories exist, test if AppleDouble files exist, report orphaned AppleDouble files, report directories inside \&.AppleDouble directories, check name encoding, heck for orphaned CNIDs in database (requires
+\fB\-e\fR)\&.
.sp
+Options:
+.PP
+\-c
.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-Open and close adouble files
+Don\'t check \&.AppleDouble stuff, only check orphaned\&.
.RE
-.RS 4
.PP
-Options:
+\-n
.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\&.
+Rebuild volume:
.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
+Sync CNIDSs from database with volume, ensure \&.AppleDouble directories exist, ensure AppleDouble files exist, delete orphaned AppleDouble files, report directories inside \&.AppleDouble directories, check name encoding by roundtripping, delete orphaned CNIDs in database (requires
+\fB\-e\fR)\&.
.sp
+Options:
+.PP
+\-C
.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)
+Converts volume from adouble:v2 to adouble:ea
.RE
-.sp
+.PP
+\-c
.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-Open and close adouble files
+Don\'t create \&.AppleDouble stuff, only cleanup orphaned\&.
.RE
-.RS 4
.PP
-Options:
+\-f
.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
.\" Title: afp.conf
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 25 Jul 2012
+.\" Date: 22 Nov 2012
.\" Manual: Netatalk 3.0
.\" Source: Netatalk 3.0
.\" Language: English
.\"
-.TH "AFP\&.CONF" "5" "25 Jul 2012" "Netatalk 3.0" "Netatalk 3.0"
+.TH "AFP\&.CONF" "5" "22 Nov 2012" "Netatalk 3.0" "Netatalk 3.0"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.RS 4
.\}
.nf
-\fIname\fR = \fIvalue \fR
-
+ \fIname\fR = \fIvalue \fR
+
.fi
.if n \{\
.RE
Any line beginning with a semicolon (\(lq;\(rq) or a hash (\(lq#\(rq) character is ignored, as are lines containing only whitespace\&.
.PP
Any line ending in a
-\(lq\e\(rq
+\(lq \e \(rq
is continued on the next line in the customary UNIX fashion\&.
.PP
The values following the equals sign in parameters are all either a string (no quotes needed) or a boolean, which may be given as yes/no, 1/0 or true/false\&. Case is not significant in boolean values, but is preserved in string values\&. Some items such as create masks are numeric\&.
.RS 4
.\}
.nf
-[baz]
-path = /foo/bar
-
+ [baz]
+ path = /foo/bar
.fi
.if n \{\
.RE
.RS 4
.\}
.nf
-[Homes]
-path = afp\-data
-basedir regex = /home
+ [Homes] path = afp\-data basedir regex = /home
.fi
.if n \{\
.SH "EXPLANATION OF GLOBAL PARAMETERS"
.SS "Authentication Options"
.PP
+ad domain = \fIDOMAIN\fR \fB(G)\fR
+.RS 4
+Append @DOMAIN to username when authenticating\&. Useful in Active Directory environments that otherwise would require the user to enter the full user@domain string\&.
+.RE
+.PP
admin auth user = \fIuser\fR \fB(G)\fR
.RS 4
Specifying eg "\fBadmin auth user = root\fR" whenever a normal user login fails, afpd will try to authenticate as the specified
These are required if the server supports the Kerberos 5 authentication UAM\&.
.RE
.PP
-ldap auth method = \fInone|simple|sasl\fR \fB(G)\fR
-.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 = \fIdn\fR \fB(G)\fR
-.RS 4
-Distinguished Name of the user for simple bind\&.
-.sp
-.RE
-.PP
-ldap auth pw = \fIpassword\fR \fB(G)\fR
-.RS 4
-Distinguished Name of the user for simple bind\&.
-.sp
-.RE
-.PP
-ldap server = \fIhost\fR \fB(G)\fR
-.RS 4
-Name or IP address of your LDAP Server\&. This is only needed for explicit ACL support in order to be able to query LDAP for UUIDs\&.
-.sp
-You can use
-\fBafpldaptest\fR(1)
-to syntactically check your config\&.
-.RE
-.PP
-ldap userbase = \fIbase dn\fR \fB(G)\fR
-.RS 4
-DN of the user container in LDAP\&.
-.sp
-.RE
-.PP
-ldap userscope = \fIscope\fR \fB(G)\fR
-.RS 4
-Search scope for user search:
-\fBbase | one | sub\fR
-.sp
-.RE
-.PP
-ldap groupbase = \fIbase dn\fR \fB(G)\fR
-.RS 4
-DN of the group container in LDAP\&.
-.sp
-.RE
-.PP
-ldap groupscope = \fIscope\fR \fB(G)\fR
-.RS 4
-Search scope for user search:
-\fBbase | one | sub\fR
-.sp
-.RE
-.PP
-ldap uuid attr = \fIdn\fR \fB(G)\fR
-.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 = \fIdn\fR \fB(G)\fR
-.RS 4
-Name of the LDAP attribute with the users short name\&.
-.sp
-.RE
-.PP
-ldap uuid string = \fISTRING\fR \fB(G)\fR
-.RS 4
-Format of the uuid string in the directory\&. A series of x and \-, where every x denotes a value 0\-9a\-f and every \- is a seperator\&.
-.sp
-Default: xxxxxxxx\-xxxx\-xxxx\-xxxx\-xxxxxxxxxxxx
-.RE
-.PP
-ldap uuid encoding = \fIstring | ms\-guid (default: string)\fR \fB(G)\fR
-.RS 4
-Format of the UUID of the LDAP attribute, allows usage of the binary objectGUID fields from Active Directory\&. If left unspecified, string is the default, which passes through the ASCII UUID returned by most other LDAP stores\&. If set to ms\-guid, the internal UUID representation is converted to and from the binary format used in the objectGUID attribute found on objects in Active Directory when interacting with the server\&.
-.PP
-string
-.RS 4
-UUID is a string, use with eg OpenDirectory\&.
-.RE
-.PP
-ms\-guid
-.RS 4
-Binary objectGUID from Active Directory
-.RE
-.RE
-.PP
-ldap group attr = \fIdn\fR \fB(G)\fR
-.RS 4
-Name of the LDAP attribute with the groups short name\&.
-.sp
-.RE
-.PP
nt domain = \fIDOMAIN\fR \fB(G)\fR, nt separator = \fISEPERATOR\fR \fB(G)\fR
.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\&.
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
-fce listener = \fIhost[:port]\fR \fB(G)\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
-fce events = \fIfmod,fdel,ddel,fcre,dcre,tmsz\fR \fB(G)\fR
-.RS 4
-Speficies which FCE events are active, default is
-\fIfmod,fdel,ddel,fcre,dcre\fR\&.
-.RE
-.PP
-fce coalesce = \fIall|delete|create\fR \fB(G)\fR
-.RS 4
-Coalesce FCE events\&.
-.RE
-.PP
-fce holdfmod = \fIseconds\fR \fB(G)\fR
+extmap file = \fIpath\fR \fB(G)\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\&.
+Sets the path to the file which defines file extension type/creator mappings\&. (default is :ETCDIR:/AppleVolumes\&.system)\&.
.RE
.PP
guest account = \fIname\fR \fB(G)\fR
.RS 4
.\}
.nf
-73: limit of Mac OS X 10\&.1
-80: limit of Mac OS X 10\&.4/10\&.5 (default)
-255: limit of recent Mac OS X
+ 73: limit of Mac OS X 10\&.1 80: limit of Mac
+ OS X 10\&.4/10\&.5 (default) 255: limit of recent Mac OS
+ X
.fi
.if n \{\
.RE
.sp .5v
.RE
.RE
+.SS "Filesystem Change Events (FCE)"
+.PP
+Netatalk includes a nifty filesystem change event mechanism where afpd processes notfiy interested listeners about certain filesytem event by UDP network datagrams\&.
+.PP
+fce listener = \fIhost[:port]\fR \fB(G)\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
+fce events = \fIfmod,fdel,ddel,fcre,dcre,tmsz\fR \fB(G)\fR
+.RS 4
+Speficies which FCE events are active, default is
+\fIfmod,fdel,ddel,fcre,dcre\fR\&.
+.RE
+.PP
+fce coalesce = \fIall|delete|create\fR \fB(G)\fR
+.RS 4
+Coalesce FCE events\&.
+.RE
+.PP
+fce holdfmod = \fIseconds\fR \fB(G)\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
.SS "Debug Parameters"
.PP
These options are useful for debugging only\&.
.sp
Do not use this option any longer as present Netatalk correctly supports server notifications, allowing connected clients to update folder listings in case another client changed the contents\&.
.RE
+.SS "Options for ACL handling"
+.PP
+For a basic mode of operation there\'s nothing to configure\&. afpd reads ACLs on the fly, calculating effective permissions and returning the calculated permissions via the so called UARights permission bits\&. On a Mac the Finder uses these bits to adjust permission in Finder windows\&. For example folder whos UNIX mode would only result in in read\-only permissions for a user will not be displayed with a read\-only icon and the user will be able to write to the folder given the folder has an ACL giving the user write access\&.
+.PP
+However, neither in Finder "Get Info" windows nor in Terminal will you be able to see the ACLs, that\'s a result of how ACLs in OS X are designed\&. If you want to be able to display ACLs on the client, things get more involed as you must then setup both client and server to be part on a authentication domain (directory service, eg LDAP, OpenDirectory)\&. The reason is, that in OS X ACLs are bound to UUIDs, not just uid\'s or gid\'s\&. Therefor afpd must be able to map every filesystem uid and gid to a UUID so that it can return the server side ACLs which are bound to UNIX uid and gid mapped to OS X UUIDs\&. Get it? Read on\&.
+.PP
+Netatalk can query a directory server using LDAP queries\&. Either the directory server already provides an UUID attribute for user and groups (Active Directory, Open Directory) or you reuse an unused attribute (or add a new one) to you directory server (eg OpenLDAP)\&.
+.PP
+The following LDAP options must be configured for Netatalk:
+.PP
+ldap auth method = \fInone|simple|sasl\fR \fB(G)\fR
+.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
+.sp
+.RE
+.PP
+ldap auth dn = \fIdn\fR \fB(G)\fR
+.RS 4
+Distinguished Name of the user for simple bind\&.
+.RE
+.PP
+ldap auth pw = \fIpassword\fR \fB(G)\fR
+.RS 4
+Distinguished Name of the user for simple bind\&.
+.RE
+.PP
+ldap server = \fIhost\fR \fB(G)\fR
+.RS 4
+Name or IP address of your LDAP Server\&. This is only needed for explicit ACL support in order to be able to query LDAP for UUIDs\&.
+.sp
+You can use
+\fBafpldaptest\fR(1)
+to syntactically check your config\&.
+.RE
+.PP
+ldap userbase = \fIbase dn\fR \fB(G)\fR
+.RS 4
+DN of the user container in LDAP\&.
+.RE
+.PP
+ldap userscope = \fIscope\fR \fB(G)\fR
+.RS 4
+Search scope for user search:
+\fBbase | one | sub\fR
+.RE
+.PP
+ldap groupbase = \fIbase dn\fR \fB(G)\fR
+.RS 4
+DN of the group container in LDAP\&.
+.RE
+.PP
+ldap groupscope = \fIscope\fR \fB(G)\fR
+.RS 4
+Search scope for user search:
+\fBbase | one | sub\fR
+.RE
+.PP
+ldap uuid attr = \fIdn\fR \fB(G)\fR
+.RS 4
+Name of the LDAP attribute with the UUIDs\&.
+.sp
+Note: this is used both for users and groups\&.
+.RE
+.PP
+ldap name attr = \fIdn\fR \fB(G)\fR
+.RS 4
+Name of the LDAP attribute with the users short name\&.
+.RE
+.PP
+ldap uuid string = \fISTRING\fR \fB(G)\fR
+.RS 4
+Format of the uuid string in the directory\&. A series of x and \-, where every x denotes a value 0\-9a\-f and every \- is a seperator\&.
+.sp
+Default: xxxxxxxx\-xxxx\-xxxx\-xxxx\-xxxxxxxxxxxx
+.RE
+.PP
+ldap uuid encoding = \fIstring | ms\-guid (default: string)\fR \fB(G)\fR
+.RS 4
+Format of the UUID of the LDAP attribute, allows usage of the binary objectGUID fields from Active Directory\&. If left unspecified, string is the default, which passes through the ASCII UUID returned by most other LDAP stores\&. If set to ms\-guid, the internal UUID representation is converted to and from the binary format used in the objectGUID attribute found on objects in Active Directory when interacting with the server\&.
+.PP
+string
+.RS 4
+UUID is a string, use with eg OpenDirectory\&.
+.RE
+.PP
+ms\-guid
+.RS 4
+Binary objectGUID from Active Directory
+.RE
+.sp
+.RE
+.PP
+ldap group attr = \fIdn\fR \fB(G)\fR
+.RS 4
+Name of the LDAP attribute with the groups short name\&.
+.RE
.SH "EXPLANATION OF VOLUME PARAMETERS"
.SS "Parameters"
.PP
is for directories only\&. Don\'t use with "\fBunix priv = no\fR"\&.
.PP
\fBExample.\ \&Volume for a collaborative workgroup\fR
+
.sp
.if n \{\
.RS 4
.\}
.nf
-file perm = 0660
-directory perm = 0770
+file perm = 0660 directory perm =
+ 0770
.fi
.if n \{\
.RE
.\}
+.sp
.RE
.PP
option will allow you to select another volume encoding\&. E\&.g\&. for western users another useful setting could be vol charset ISO\-8859\-15\&.
\fBafpd\fR
will accept any
-\fBiconv\fR(1)
+\fB iconv \fR(1)
provided charset\&. If a character cannot be converted from the
\fBmac charset\fR
to the selected
$(top_srcdir)/etc/afpd/file.c \
$(top_srcdir)/etc/afpd/filedir.c \
$(top_srcdir)/etc/afpd/fork.c \
- $(top_srcdir)/etc/afpd/gettok.c \
$(top_srcdir)/etc/afpd/hash.c \
$(top_srcdir)/etc/afpd/mangle.c \
$(top_srcdir)/etc/afpd/messages.c \