netatalk: ad_open.c File Reference

netatalk 4.5.1
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
ad_open.c File Reference

Part of Netatalk's AppleDouble implementatation. More...

`#include <arpa/inet.h>`
`#include <errno.h>`
`#include <stdarg.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <sys/param.h>`
`#include <atalk/adouble.h>`
`#include <atalk/compat.h>`
`#include <atalk/ea.h>`
`#include <atalk/errchk.h>`
`#include <atalk/logger.h>`
`#include <atalk/unix.h>`
`#include <atalk/util.h>`
`#include <atalk/volume.h>`

## Data Structures
struct | entry

## Macros
#define | ADEDOFF_MAGIC (0)
#define | ADEDOFF_VERSION (ADEDOFF_MAGIC + ADEDLEN_MAGIC)
#define | ADEDOFF_FILLER (ADEDOFF_VERSION + ADEDLEN_VERSION)
#define | ADEDOFF_NENTRIES (ADEDOFF_FILLER + ADEDLEN_FILLER)
#define | ADEDLEN_INIT 0
#define | ADEDOFF_NAME_V2 (AD_HEADER_LEN + ADEID_NUM_V2*AD_ENTRY_LEN)
#define | ADEDOFF_COMMENT_V2 (ADEDOFF_NAME_V2 + ADEDLEN_NAME)
#define | ADEDOFF_FILEDATESI (ADEDOFF_COMMENT_V2 + ADEDLEN_COMMENT)
#define | ADEDOFF_FINDERI_V2 (ADEDOFF_FILEDATESI + ADEDLEN_FILEDATESI)
#define | ADEDOFF_DID (ADEDOFF_FINDERI_V2 + ADEDLEN_FINDERI)
#define | ADEDOFF_AFPFILEI (ADEDOFF_DID + ADEDLEN_DID)
#define | ADEDOFF_SHORTNAME (ADEDOFF_AFPFILEI + ADEDLEN_AFPFILEI)
#define | ADEDOFF_PRODOSFILEI (ADEDOFF_SHORTNAME + ADEDLEN_SHORTNAME)
#define | ADEDOFF_PRIVDEV (ADEDOFF_PRODOSFILEI + ADEDLEN_PRODOSFILEI)
#define | ADEDOFF_PRIVINO (ADEDOFF_PRIVDEV + ADEDLEN_PRIVDEV)
#define | ADEDOFF_PRIVSYN (ADEDOFF_PRIVINO + ADEDLEN_PRIVINO)
#define | ADEDOFF_PRIVID (ADEDOFF_PRIVSYN + ADEDLEN_PRIVSYN)
#define | ADEDOFF_RFORK_V2 (ADEDOFF_PRIVID + ADEDLEN_PRIVID)
#define | ADEDOFF_FINDERI_EA (AD_HEADER_LEN + ADEID_NUM_EA * AD_ENTRY_LEN)
#define | ADEDOFF_COMMENT_EA (ADEDOFF_FINDERI_EA + ADEDLEN_FINDERI)
#define | ADEDOFF_FILEDATESI_EA (ADEDOFF_COMMENT_EA + ADEDLEN_COMMENT)
#define | ADEDOFF_AFPFILEI_EA (ADEDOFF_FILEDATESI_EA + ADEDLEN_FILEDATESI)
#define | ADEDOFF_PRIVDEV_EA (ADEDOFF_AFPFILEI_EA + ADEDLEN_AFPFILEI)
#define | ADEDOFF_PRIVINO_EA (ADEDOFF_PRIVDEV_EA + ADEDLEN_PRIVDEV)
#define | ADEDOFF_PRIVSYN_EA (ADEDOFF_PRIVINO_EA + ADEDLEN_PRIVINO)
#define | ADEDOFF_PRIVID_EA (ADEDOFF_PRIVSYN_EA + ADEDLEN_PRIVSYN)
#define | TIMEWARP_DELTA 157680000
#define | ADFLAGS2LOGSTRBUFSIZ 128
#define | OPENFLAGS2LOGSTRBUFSIZ 128
#define | EMULATE_SUIDDIR
#define | DEFMASK 07700

## Functions
static int | ad_mkrf (const char *path)
| Takes a path to an AppleDouble file and creates the parent .AppleDouble directory.
static int | ad_header_read (const char *path, struct adouble *ad, const struct stat *hst)
static int | ad_header_upgrade (struct adouble *ad, const char *name)
static int | ad_header_read_ea (const char *path, struct adouble *ad, const struct stat *hst)
static int | ad_header_upgrade_ea (struct adouble *ad, const char *name)
off_t | ad_reso_size (const char *path, int adflags, struct adouble *ad)
static int | ad_mkrf_osx (const char *path)
const char * | adflags2logstr (int adflags)
const char * | openflags2logstr (int oflags)
static uint32_t | get_eid (uint32_t eid)
int | ad_init_offsets (struct adouble *ad)
static int | new_ad_header (struct adouble *ad, const char *path, struct stat *stp, int adflags)
static int | parse_entries (struct adouble *ad, uint16_t nentries, size_t valid_data_len)
| Read an AppleDouble buffer.
int | ad_valid_header_osx (const char *path)
static int | ad_convert_osx (const char *path, struct adouble *ad)
| Convert from Apple's ._ file to Netatalk.
static int | ad_header_read_osx (const char *path, struct adouble *ad, struct stat *hst)
static int | ad_chown (const char *path, struct stat *stbuf)
| if we are root change path user/ group
static int | ad_mode_st (const char *path, mode_t *mode, struct stat *stbuf)
static int | ad_error (struct adouble *ad, int adflags)
| Error handling for adouble header(=metadata) file open error.
static int | ad2openflags (const struct adouble *ad, int adfile, int adflags)
| Map ADFLAGS to open() flags.
static int | ad_open_df (const char *path, int adflags, mode_t mode, struct adouble *ad)
static int | ad_open_hf_v2 (const char *path, int adflags, mode_t mode, struct adouble *ad)
static int | ad_open_hf_ea (const char *path, int adflags, int mode, struct adouble *ad)
static int | ad_open_hf (const char *path, int adflags, int mode, struct adouble *ad)
static int | ad_open_rf_v2 (const char *path, int adflags, int mode, struct adouble *ad)
static int | ad_open_rf_ea (const char *path, int adflags, int mode, struct adouble *ad)
static int | ad_open_rf (const char *path, int adflags, int mode, struct adouble *ad)
| Open resource fork.
static bool | ad_entry_check_size (uint32_t eid, size_t bufsize, uint32_t off, uint32_t got_len)
void * | ad_entry (const struct adouble *ad, int eid)
off_t | ad_getentryoff (const struct adouble *ad, int eid)
const char * | ad_path_ea (const char *path, int adflags)
const char * | ad_path_osx (const char *path, int adflags)
const char * | ad_path (const char *path, int adflags)
| Put the .AppleDouble where it needs to be:
char * | ad_dir (const char *path)
| Support inherited protection modes for AppleDouble files. The supplied mode is ANDed with the parent directory's mask value in lieu of "umask", and that value is returned.
int | ad_setfuid (const uid_t id)
uid_t | ad_getfuid (void)
int | ad_stat (const char *path, struct stat *stbuf)
int | ad_mode (const char *path, mode_t mode)
int | ad_mkdir (const char *path, mode_t mode)
static void | ad_init_func (struct adouble *ad)
void | ad_init_old (struct adouble *ad, int flags, int options)
void | ad_init (struct adouble *ad, const struct vol *vol)
int | ad_open (struct adouble *ad, const char *path, int adflags,...)
| Open data-, metadata(header)- or resource fork.
int | ad_metadata (const char *name, int flags, struct adouble *adp)
| open metadata, possibly as root
int | ad_metadataat (int dirfd, const char *name, int flags, struct adouble *adp)
int | ad_refresh (const char *path, struct adouble *ad)
int | ad_openat (struct adouble *ad, int dirfd, const char *path, int adflags,...)
mode_t | ad_hf_mode (mode_t mode)

## Variables
static uid_t | default_uid = -1
static struct adouble_fops | ad_adouble
static struct adouble_fops | ad_adouble_ea
static const struct entry | entry_order2 [ADEID_NUM_V2+1]
static const struct entry | entry_order_ea [ADEID_NUM_EA+1]

## Detailed Description

Part of Netatalk's AppleDouble implementatation.

See also
  include/atalk/adouble.h

## Macro Definition Documentation

## ◆ ADEDLEN_INIT

#define ADEDLEN_INIT 0

initial lengths of some of the fields

## ◆ ADEDOFF_AFPFILEI

#define ADEDOFF_AFPFILEI (ADEDOFF_DID + ADEDLEN_DID)

## ◆ ADEDOFF_AFPFILEI_EA

#define ADEDOFF_AFPFILEI_EA (ADEDOFF_FILEDATESI_EA + ADEDLEN_FILEDATESI)

## ◆ ADEDOFF_COMMENT_EA

#define ADEDOFF_COMMENT_EA (ADEDOFF_FINDERI_EA + ADEDLEN_FINDERI)

## ◆ ADEDOFF_COMMENT_V2

#define ADEDOFF_COMMENT_V2 (ADEDOFF_NAME_V2 + ADEDLEN_NAME)

## ◆ ADEDOFF_DID

#define ADEDOFF_DID (ADEDOFF_FINDERI_V2 + ADEDLEN_FINDERI)

## ◆ ADEDOFF_FILEDATESI

#define ADEDOFF_FILEDATESI (ADEDOFF_COMMENT_V2 + ADEDLEN_COMMENT)

## ◆ ADEDOFF_FILEDATESI_EA

#define ADEDOFF_FILEDATESI_EA (ADEDOFF_COMMENT_EA + ADEDLEN_COMMENT)

## ◆ ADEDOFF_FILLER

#define ADEDOFF_FILLER (ADEDOFF_VERSION + ADEDLEN_VERSION)

## ◆ ADEDOFF_FINDERI_EA

#define ADEDOFF_FINDERI_EA (AD_HEADER_LEN + ADEID_NUM_EA * AD_ENTRY_LEN)

## ◆ ADEDOFF_FINDERI_V2

#define ADEDOFF_FINDERI_V2 (ADEDOFF_FILEDATESI + ADEDLEN_FILEDATESI)

## ◆ ADEDOFF_MAGIC

#define ADEDOFF_MAGIC (0)

## ◆ ADEDOFF_NAME_V2

#define ADEDOFF_NAME_V2 (AD_HEADER_LEN + ADEID_NUM_V2*AD_ENTRY_LEN)

## ◆ ADEDOFF_NENTRIES

#define ADEDOFF_NENTRIES (ADEDOFF_FILLER + ADEDLEN_FILLER)

## ◆ ADEDOFF_PRIVDEV

#define ADEDOFF_PRIVDEV (ADEDOFF_PRODOSFILEI + ADEDLEN_PRODOSFILEI)

## ◆ ADEDOFF_PRIVDEV_EA

#define ADEDOFF_PRIVDEV_EA (ADEDOFF_AFPFILEI_EA + ADEDLEN_AFPFILEI)

## ◆ ADEDOFF_PRIVID

#define ADEDOFF_PRIVID (ADEDOFF_PRIVSYN + ADEDLEN_PRIVSYN)

## ◆ ADEDOFF_PRIVID_EA

#define ADEDOFF_PRIVID_EA (ADEDOFF_PRIVSYN_EA + ADEDLEN_PRIVSYN)

## ◆ ADEDOFF_PRIVINO

#define ADEDOFF_PRIVINO (ADEDOFF_PRIVDEV + ADEDLEN_PRIVDEV)

## ◆ ADEDOFF_PRIVINO_EA

#define ADEDOFF_PRIVINO_EA (ADEDOFF_PRIVDEV_EA + ADEDLEN_PRIVDEV)

## ◆ ADEDOFF_PRIVSYN

#define ADEDOFF_PRIVSYN (ADEDOFF_PRIVINO + ADEDLEN_PRIVINO)

## ◆ ADEDOFF_PRIVSYN_EA

#define ADEDOFF_PRIVSYN_EA (ADEDOFF_PRIVINO_EA + ADEDLEN_PRIVINO)

## ◆ ADEDOFF_PRODOSFILEI

#define ADEDOFF_PRODOSFILEI (ADEDOFF_SHORTNAME + ADEDLEN_SHORTNAME)

## ◆ ADEDOFF_RFORK_V2

#define ADEDOFF_RFORK_V2 (ADEDOFF_PRIVID + ADEDLEN_PRIVID)

## ◆ ADEDOFF_SHORTNAME

#define ADEDOFF_SHORTNAME (ADEDOFF_AFPFILEI + ADEDLEN_AFPFILEI)

## ◆ ADEDOFF_VERSION

#define ADEDOFF_VERSION (ADEDOFF_MAGIC + ADEDLEN_MAGIC)

## ◆ ADFLAGS2LOGSTRBUFSIZ

#define ADFLAGS2LOGSTRBUFSIZ 128

## ◆ DEFMASK

#define DEFMASK 07700

be conservative

## ◆ EMULATE_SUIDDIR

#define EMULATE_SUIDDIR

## ◆ OPENFLAGS2LOGSTRBUFSIZ

#define OPENFLAGS2LOGSTRBUFSIZ 128

## ◆ TIMEWARP_DELTA

#define TIMEWARP_DELTA 157680000

this is to prevent changing timezones from causing problems with localtime volumes. the screw-up is 30 years. we use a delta of 5 years

## Function Documentation

## ◆ ad2openflags()

int ad2openflags | ( | const struct adouble * | ad,
|  | int | adfile,
|  | int | adflags )
| static

Map ADFLAGS to open() flags.

Parameters

  [in] | ad | the adouble structure
  [in] | adfile | the file you really want to open: ADFLAGS_DF or ADFLAGS_HF
  [in] | adflags | flags from ad_open(..., adflags, ...)

Returns
  mapped flags suitable for calling open()

## ◆ ad_chown()

int ad_chown | ( | const char * | path,
|  | struct stat * | stbuf )
| static

if we are root change path user/ group

Note
  It can be a native function for BSD cf. FAQ.Q10

Parameters

  path | pathname to chown
  stbuf | parent directory inode

use fstat and fchown or lchown with linux?

## ◆ ad_convert_osx()

int ad_convert_osx | ( | const char * | path,
|  | struct adouble * | ad )
| static

Convert from Apple's ._ file to Netatalk.

Apple's AppleDouble may contain a FinderInfo entry longer then 32 bytes containing packed xattrs. Netatalk can't deal with that, so we simply discard the packed xattrs.

As we call ad_open() which might result in a recursion, just to be sure use static variable in_conversion to check for that.

Returns
  -1 in case an error occured, 0 if no conversion was done, 1 otherwise

## ◆ ad_dir()

char * ad_dir | ( | const char * | path | ) |

Support inherited protection modes for AppleDouble files. The supplied mode is ANDed with the parent directory's mask value in lieu of "umask", and that value is returned.

## ◆ ad_entry()

void * ad_entry | ( | const struct adouble * | ad,
|  | int | eid )

## ◆ ad_entry_check_size()

bool ad_entry_check_size | ( | uint32_t | eid,
|  | size_t | bufsize,
|  | uint32_t | off,
|  | uint32_t | got_len )
| static

## ◆ ad_error()

int ad_error | ( | struct adouble * | ad,
|  | int | adflags )
| static

Error handling for adouble header(=metadata) file open error.

We're called because opening ADFLAGS_HF caused an error.

1. In case ad_open is called with ADFLAGS_NOHF the error is suppressed.
2. Open non-existent resource fork, this will just result in first read return EOF
3. If ad_open was called with ADFLAGS_DF we may have opened the datafork and thus ought to close it before returning with an error condition.

## ◆ ad_getentryoff()

off_t ad_getentryoff | ( | const struct adouble * | ad,
|  | int | eid )

## ◆ ad_getfuid()

uid_t ad_getfuid | ( | void |  | ) |

## ◆ ad_header_read()

int ad_header_read | ( | const char * | path,
|  | struct adouble * | ad,
|  | const struct stat * | hst )
| static

## ◆ ad_header_read_ea()

int ad_header_read_ea | ( | const char * | path,
|  | struct adouble * | ad,
|  | const struct stat * | hst )
| static

## ◆ ad_header_read_osx()

int ad_header_read_osx | ( | const char * | path,
|  | struct adouble * | ad,
|  | struct stat * | hst )
| static

Read an ._ file, only uses the resofork, finderinfo is taken from EA

## ◆ ad_header_upgrade()

int ad_header_upgrade | ( | struct adouble * | ad,
|  | const char * | name )
| static

## ◆ ad_header_upgrade_ea()

int ad_header_upgrade_ea | ( | struct adouble * | ad,
|  | const char * | name )
| static

## ◆ ad_hf_mode()

mode_t ad_hf_mode | ( | mode_t | mode | ) |

build a resource fork mode from the data fork mode: remove X mode and extend header to RW if R or W (W if R for locking),

## ◆ ad_init()

void ad_init | ( | struct adouble * | ad,
|  | const struct vol * | vol )

## ◆ ad_init_func()

void ad_init_func | ( | struct adouble * | ad | ) |
| static

## ◆ ad_init_offsets()

int ad_init_offsets | ( | struct adouble * | ad | ) |

Initialize offset pointers

## ◆ ad_init_old()

void ad_init_old | ( | struct adouble * | ad,
|  | int | flags,
|  | int | options )

## ◆ ad_metadata()

int ad_metadata | ( | const char * | name,
|  | int | flags,
|  | struct adouble * | adp )

open metadata, possibly as root

Return only metadata but try very hard i.e. at first try as user, then try as root.

Parameters

  name | name of file/dir
  flags | ADFLAGS_DIR: name is a directory ADFLAGS_CHECK_OF: test if name is open by us or another afpd process
  adp | pointer to struct adouble

## ◆ ad_metadataat()

int ad_metadataat | ( | int | dirfd,
|  | const char * | name,
|  | int | flags,
|  | struct adouble * | adp )

openat like wrapper for ad_metadata

## ◆ ad_mkdir()

int ad_mkdir | ( | const char * | path,
|  | mode_t | mode )

Use mkdir() with mode bits taken from ad_mode().

## ◆ ad_mkrf()

int ad_mkrf | ( | const char * | path | ) |
| static

Takes a path to an AppleDouble file and creates the parent .AppleDouble directory.

Example:

path: "/path/.AppleDouble/file" => mkdir("/path/.AppleDouble/") (in ad_mkdir())

## ◆ ad_mkrf_osx()

int ad_mkrf_osx | ( | const char * | path | ) |
| static

## ◆ ad_mode()

int ad_mode | ( | const char * | path,
|  | mode_t | mode )

return access right of path parent directory

## ◆ ad_mode_st()

int ad_mode_st | ( | const char * | path,
|  | mode_t * | mode,
|  | struct stat * | stbuf )
| static

return access right and inode of path parent directory

## ◆ ad_open()

int ad_open | ( | struct adouble * | ad,
|  | const char * | path,
|  | int | adflags,
|  |  | ... )

Open data-, metadata(header)- or resource fork.

ad_open(struct adouble *ad, const char *path, int adflags, int flags)
ad_open(struct adouble *ad, const char *path, int adflags, int flags, mode_t mode)
ad_open
int ad_open(struct adouble *ad, const char *path, int adflags,...)
Open data-, metadata(header)- or resource fork.
Definition ad_open.c:2308
flags
static dbd_flags_t flags
Definition cmd_dbd.c:43
adouble
Definition adouble.h:191
path
Definition include/atalk/directory.h:123

You must call ad_init() before ad_open, usually you'll just call it like this:

struct adoube ad;
ad_init(&ad, vol->v_adouble, vol->v_ad_options);
ad_init
void ad_init(struct adouble *, const struct vol *)
Definition ad_open.c:2242
vol
Definition include/atalk/volume.h:33
vol::v_ad_options
int v_ad_options
Definition include/atalk/volume.h:51
vol::v_adouble
int v_adouble
Definition include/atalk/volume.h:50

Open a files data fork, metadata fork or resource fork.

Parameters

  [in,out] | ad | pointer to struct adouble
  [in] | path | Path to file or directory
  [in] | adflags | Flags specifying which fork to open, can be or'd (see below)
  [in] | ... | mode used with O_CREATE

Regular adflags:

- ADFLAGS_DF: open data fork
- ADFLAGS_RF: open resource fork
- ADFLAGS_HF: open header (metadata) file
- ADFLAGS_NOHF: it's not an error if header file couldn't be opened
- ADFLAGS_NORF: it's not an error if reso fork couldn't be opened
- ADFLAGS_DIR: if path is a directory you MUST or ADFLAGS_DIR to adflags

Access mode for the forks:

- ADFLAGS_RDONLY: open read only
- ADFLAGS_RDWR: open read write

Creation flags:

- ADFLAGS_CREATE: create if not existing
- ADFLAGS_TRUNC: truncate

Special flags:

- ADFLAGS_CHECK_OF: check for open forks from us and other afpd's
- ADFLAGS_SETSHRMD: this adouble struct will be used to set sharemode locks. This basically results in the files being opened RW instead of RDONLY.

The open mode flags (rw vs ro) have to take into account all the following requirements:

- we remember open fds for files because me must avoid a single close releasing fcntl locks for other fds of the same file

Bug
  on Solaris (HAVE_EAFD) ADFLAGS_RF doesn't work without ADFLAGS_HF, because it checks whether ad_meta_fileno() is already opened. As a workaround pass ADFLAGS_SETSHRMD.

Returns
  0 on success, any other value indicates an error

## ◆ ad_open_df()

int ad_open_df | ( | const char * | path,
|  | int | adflags,
|  | mode_t | mode,
|  | struct adouble * | ad )
| static

## ◆ ad_open_hf()

int ad_open_hf | ( | const char * | path,
|  | int | adflags,
|  | int | mode,
|  | struct adouble * | ad )
| static

## ◆ ad_open_hf_ea()

int ad_open_hf_ea | ( | const char * | path,
|  | int | adflags,
|  | int | mode,
|  | struct adouble * | ad )
| static

## ◆ ad_open_hf_v2()

int ad_open_hf_v2 | ( | const char * | path,
|  | int | adflags,
|  | mode_t | mode,
|  | struct adouble * | ad )
| static

## ◆ ad_open_rf()

int ad_open_rf | ( | const char * | path,
|  | int | adflags,
|  | int | mode,
|  | struct adouble * | ad )
| static

Open resource fork.

## ◆ ad_open_rf_ea()

int ad_open_rf_ea | ( | const char * | path,
|  | int | adflags,
|  | int | mode,
|  | struct adouble * | ad )
| static

## ◆ ad_open_rf_v2()

int ad_open_rf_v2 | ( | const char * | path,
|  | int | adflags,
|  | int | mode,
|  | struct adouble * | ad )
| static

## ◆ ad_openat()

int ad_openat | ( | struct adouble * | ad,
|  | int | dirfd,
|  | const char * | path,
|  | int | adflags,
|  |  | ... )

## ◆ ad_path()

const char * ad_path | ( | const char * | path,
|  | int | adflags )

Put the .AppleDouble where it needs to be:

/ a/.AppleDouble/b
a/b
\ b/.AppleDouble/.Parent

Bug
  should do something for pathname > MAXPATHLEN

## ◆ ad_path_ea()

const char * ad_path_ea | ( | const char * | path,
|  | int | adflags )

## ◆ ad_path_osx()

const char * ad_path_osx | ( | const char * | path,
|  | int | adflags )

## ◆ ad_refresh()

int ad_refresh | ( | const char * | path,
|  | struct adouble * | ad )

## ◆ ad_reso_size()

off_t ad_reso_size | ( | const char * | path,
|  | int | adflags,
|  | struct adouble * | ad )

Get resofork length for adouble:ea, parameter 'ad' may be NULL

## ◆ ad_setfuid()

int ad_setfuid | ( | const uid_t | id | ) |

## ◆ ad_stat()

int ad_stat | ( | const char * | path,
|  | struct stat * | stbuf )

stat path parent directory

## ◆ ad_valid_header_osx()

int ad_valid_header_osx | ( | const char * | path | ) |

## ◆ adflags2logstr()

const char * adflags2logstr | ( | int | adflags | ) |

## ◆ get_eid()

uint32_t get_eid | ( | uint32_t | eid | ) |
| static

## ◆ new_ad_header()

int new_ad_header | ( | struct adouble * | ad,
|  | const char * | path,
|  | struct stat * | stp,
|  | int | adflags )
| static

## ◆ openflags2logstr()

const char * openflags2logstr | ( | int | oflags | ) |

## ◆ parse_entries()

int parse_entries | ( | struct adouble * | ad,
|  | uint16_t | nentries,
|  | size_t | valid_data_len )
| static

Read an AppleDouble buffer.

Returns
  0 on success, -1 if an entry was malformatted

## Variable Documentation

## ◆ ad_adouble

struct adouble_fops ad_adouble
| static

Initial value:
= {
&ad_path,
&ad_mkrf,
&ad_rebuild_adouble_header_v2,
&ad_header_read,
&ad_header_upgrade,
}
ad_header_upgrade
static int ad_header_upgrade(struct adouble *ad, const char *name)
Definition ad_open.c:1037
ad_mkrf
static int ad_mkrf(const char *path)
Takes a path to an AppleDouble file and creates the parent .AppleDouble directory.
Definition ad_open.c:955
ad_header_read
static int ad_header_read(const char *path, struct adouble *ad, const struct stat *hst)
Definition ad_open.c:517
ad_rebuild_adouble_header_v2
int ad_rebuild_adouble_header_v2(struct adouble *)
Definition ad_flush.c:53
ad_path
const char * ad_path(const char *, int)
Put the .AppleDouble where it needs to be:
Definition ad_open.c:2034

## ◆ ad_adouble_ea

struct adouble_fops ad_adouble_ea
| static

Initial value:
= {
&ad_path_osx,
&ad_mkrf_osx,
&ad_rebuild_adouble_header_ea,
&ad_header_read_ea,
&ad_header_upgrade_ea,
}
ad_header_read_ea
static int ad_header_read_ea(const char *path, struct adouble *ad, const struct stat *hst)
Definition ad_open.c:851
ad_header_upgrade_ea
static int ad_header_upgrade_ea(struct adouble *ad, const char *name)
Definition ad_open.c:1042
ad_mkrf_osx
static int ad_mkrf_osx(const char *path)
Definition ad_open.c:985
ad_rebuild_adouble_header_ea
int ad_rebuild_adouble_header_ea(struct adouble *)
Definition ad_flush.c:93
ad_path_osx
const char * ad_path_osx(const char *path, int adflags)
Definition ad_open.c:1983

## ◆ default_uid

uid_t default_uid = -1
| static

## ◆ entry_order2

const struct entry entry_order2[ADEID_NUM_V2+1]
| static

Initial value:
= {
{ADEID_NAME, ADEDOFF_NAME_V2, ADEDLEN_INIT},
{ADEID_COMMENT, ADEDOFF_COMMENT_V2, ADEDLEN_COMMENT},
{ADEID_FILEDATESI, ADEDOFF_FILEDATESI, ADEDLEN_FILEDATESI},
{ADEID_FINDERI, ADEDOFF_FINDERI_V2, ADEDLEN_FINDERI},
{ADEID_DID, ADEDOFF_DID, ADEDLEN_DID},
{ADEID_AFPFILEI, ADEDOFF_AFPFILEI, ADEDLEN_AFPFILEI},
{ADEID_SHORTNAME, ADEDOFF_SHORTNAME, ADEDLEN_INIT},
{ADEID_PRODOSFILEI, ADEDOFF_PRODOSFILEI, ADEDLEN_PRODOSFILEI},
{ADEID_PRIVDEV, ADEDOFF_PRIVDEV, ADEDLEN_PRIVDEV},
{ADEID_PRIVINO, ADEDOFF_PRIVINO, ADEDLEN_PRIVINO},
{ADEID_PRIVSYN, ADEDOFF_PRIVSYN, ADEDLEN_PRIVSYN},
{ADEID_PRIVID, ADEDOFF_PRIVID, ADEDLEN_PRIVID},
{ADEID_RFORK, ADEDOFF_RFORK_V2, ADEDLEN_INIT},
{0, 0, 0}
}
ADEDOFF_FINDERI_V2
#define ADEDOFF_FINDERI_V2
Definition ad_open.c:70
ADEDOFF_PRODOSFILEI
#define ADEDOFF_PRODOSFILEI
Definition ad_open.c:74
ADEDOFF_PRIVID
#define ADEDOFF_PRIVID
Definition ad_open.c:78
ADEDOFF_RFORK_V2
#define ADEDOFF_RFORK_V2
Definition ad_open.c:79
ADEDOFF_PRIVINO
#define ADEDOFF_PRIVINO
Definition ad_open.c:76
ADEDOFF_PRIVDEV
#define ADEDOFF_PRIVDEV
Definition ad_open.c:75
ADEDLEN_INIT
#define ADEDLEN_INIT
Definition ad_open.c:60
ADEDOFF_PRIVSYN
#define ADEDOFF_PRIVSYN
Definition ad_open.c:77
ADEDOFF_DID
#define ADEDOFF_DID
Definition ad_open.c:71
ADEDOFF_AFPFILEI
#define ADEDOFF_AFPFILEI
Definition ad_open.c:72
ADEDOFF_FILEDATESI
#define ADEDOFF_FILEDATESI
Definition ad_open.c:69
ADEDOFF_NAME_V2
#define ADEDOFF_NAME_V2
Definition ad_open.c:67
ADEDOFF_SHORTNAME
#define ADEDOFF_SHORTNAME
Definition ad_open.c:73
ADEDOFF_COMMENT_V2
#define ADEDOFF_COMMENT_V2
Definition ad_open.c:68
ADEID_COMMENT
#define ADEID_COMMENT
Definition adouble.h:57
ADEID_PRIVDEV
#define ADEID_PRIVDEV
Definition adouble.h:71
ADEID_PRIVID
#define ADEID_PRIVID
Definition adouble.h:74
ADEID_PRIVSYN
#define ADEID_PRIVSYN
Definition adouble.h:73
ADEDLEN_PRIVDEV
#define ADEDLEN_PRIVDEV
Definition adouble.h:110
ADEDLEN_AFPFILEI
#define ADEDLEN_AFPFILEI
Definition adouble.h:103
ADEDLEN_COMMENT
#define ADEDLEN_COMMENT
Definition adouble.h:98
ADEID_RFORK
#define ADEID_RFORK
Definition adouble.h:55
ADEDLEN_PRIVSYN
#define ADEDLEN_PRIVSYN
Definition adouble.h:112
ADEDLEN_PRIVID
#define ADEDLEN_PRIVID
Definition adouble.h:113
ADEID_FINDERI
#define ADEID_FINDERI
Definition adouble.h:62
ADEDLEN_DID
#define ADEDLEN_DID
Definition adouble.h:109
ADEDLEN_PRIVINO
#define ADEDLEN_PRIVINO
Definition adouble.h:111
ADEID_PRIVINO
#define ADEID_PRIVINO
Definition adouble.h:72
ADEDLEN_FILEDATESI
#define ADEDLEN_FILEDATESI
Definition adouble.h:101
ADEID_FILEDATESI
#define ADEID_FILEDATESI
Definition adouble.h:61
ADEID_PRODOSFILEI
#define ADEID_PRODOSFILEI
Definition adouble.h:64
ADEID_NAME
#define ADEID_NAME
Definition adouble.h:56
ADEID_SHORTNAME
#define ADEID_SHORTNAME
Definition adouble.h:66
ADEID_AFPFILEI
#define ADEID_AFPFILEI
Definition adouble.h:67
ADEID_DID
#define ADEID_DID
Definition adouble.h:68
ADEDLEN_PRODOSFILEI
#define ADEDLEN_PRODOSFILEI
Definition adouble.h:105
ADEDLEN_FINDERI
#define ADEDLEN_FINDERI
Definition adouble.h:100

## ◆ entry_order_ea

const struct entry entry_order_ea[ADEID_NUM_EA+1]
| static

Initial value:
= {
{ADEID_FINDERI, ADEDOFF_FINDERI_EA, ADEDLEN_FINDERI},
{ADEID_COMMENT, ADEDOFF_COMMENT_EA, ADEDLEN_COMMENT},
{ADEID_FILEDATESI, ADEDOFF_FILEDATESI_EA, ADEDLEN_FILEDATESI},
{ADEID_AFPFILEI, ADEDOFF_AFPFILEI_EA, ADEDLEN_AFPFILEI},
{ADEID_PRIVDEV, ADEDOFF_PRIVDEV_EA, ADEDLEN_PRIVDEV},
{ADEID_PRIVINO, ADEDOFF_PRIVINO_EA, ADEDLEN_PRIVINO},
{ADEID_PRIVSYN, ADEDOFF_PRIVSYN_EA, ADEDLEN_PRIVSYN},
{ADEID_PRIVID, ADEDOFF_PRIVID_EA, ADEDLEN_PRIVID},
{0, 0, 0}
}
ADEDOFF_PRIVINO_EA
#define ADEDOFF_PRIVINO_EA
Definition ad_open.c:87
ADEDOFF_PRIVSYN_EA
#define ADEDOFF_PRIVSYN_EA
Definition ad_open.c:88
ADEDOFF_PRIVDEV_EA
#define ADEDOFF_PRIVDEV_EA
Definition ad_open.c:86
ADEDOFF_COMMENT_EA
#define ADEDOFF_COMMENT_EA
Definition ad_open.c:83
ADEDOFF_PRIVID_EA
#define ADEDOFF_PRIVID_EA
Definition ad_open.c:89
ADEDOFF_FILEDATESI_EA
#define ADEDOFF_FILEDATESI_EA
Definition ad_open.c:84
ADEDOFF_AFPFILEI_EA
#define ADEDOFF_AFPFILEI_EA
Definition ad_open.c:85
ADEDOFF_FINDERI_EA
#define ADEDOFF_FINDERI_EA
Definition ad_open.c:82