xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

aaip_0_2.c File Reference
#include <ctype.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <pwd.h>
#include <grp.h>
#include <sys/stat.h>
#include "libisofs.h"
#include "util.h"
#include "messages.h"
#include "aaip_0_2.h"
#include "aaip-os-dummy.c"
Include dependency graph for aaip_0_2.c:

Go to the source code of this file.

Data Structures

struct  aaip_state
 

Macros

#define Aaip_EXEC   1
 
#define Aaip_WRITE   2
 
#define Aaip_READ   4
 
#define Aaip_TRANSLATE   0
 
#define Aaip_ACL_USER_OBJ   1
 
#define Aaip_ACL_USER   2
 
#define Aaip_ACL_GROUP_OBJ   3
 
#define Aaip_ACL_GROUP   4
 
#define Aaip_ACL_MASK   5
 
#define Aaip_ACL_OTHER   6
 
#define Aaip_SWITCH_MARK   8
 
#define Aaip_ACL_USER_N   10
 
#define Aaip_ACL_GROUP_N   12
 
#define Aaip_FUTURE_VERSION   15
 
#define Aaip_with_short_namespaceS   yes
 
#define Aaip_max_named_spacE   0x06
 
#define Aaip_min_named_spacE   0x02
 
#define Aaip_maxdef_namespacE   0x1f
 
#define Aaip_namespace_literaL   0x01
 
#define Aaip_namespace_systeM   0x02
 
#define Aaip_namespace_useR   0x03
 
#define Aaip_namespace_isofS   0x04
 
#define Aaip_namespace_trusteD   0x05
 
#define Aaip_namespace_securitY   0x06
 
#define Aaip_max_name_expansioN   9
 
#define Aaip_buffer_sizE   4096
 
#define Aaip_buffer_reservE   (257 + 3 * 2)
 
#define Aaip_with_ring_buffeR   yes
 
#define Aaip_initial_name_leN   256
 
#define Aaip_initial_value_leN   256
 
#define Aaip_initial_list_sizE   2
 
#define Aaip_list_enlargeR   1.5
 

Functions

static int aaip_encode_pair (char *name, size_t attr_length, char *attr, unsigned int *num_recs, size_t *comp_size, unsigned char *result, size_t result_fill, int flag)
 
ssize_t aaip_encode (size_t num_attrs, char **names, size_t *value_lengths, char **values, size_t *result_len, unsigned char **result, int flag)
 
static void aaip_encode_byte (unsigned char *result, size_t *result_fill, unsigned char value)
 
static int aaip_encode_comp (unsigned char *result, size_t *result_fill, int prefix, char *data, size_t l, int flag)
 
static ssize_t aaip_encode_acl_text (char *acl_text, mode_t st_mode, size_t result_size, unsigned char *result, int flag)
 
int aaip_encode_acl (char *acl_text, mode_t st_mode, size_t *result_len, unsigned char **result, int flag)
 
static double aaip_numeric_id (char *name, int flag)
 
static int aaip_make_aaip_perms (int r, int w, int x)
 
int aaip_encode_both_acl (char *a_acl_text, char *d_acl_text, mode_t st_mode, size_t *result_len, unsigned char **result, int flag)
 
int aaip_cleanout_st_mode (char *acl_text, mode_t *in_st_mode, int flag)
 
int aaip_add_acl_st_mode (char *acl_text, mode_t st_mode, int flag)
 
size_t aaip_count_bytes (unsigned char *data, int flag)
 
size_t aaip_sizeof_aaip_state (void)
 
int aaip_init_aaip_state (struct aaip_state *aaip, int flag)
 
static int aaip_ring_adr (struct aaip_state *aaip, size_t idx, size_t todo, unsigned char **start_pt, size_t *at_start_pt, size_t *at_recs, int flag)
 
static int aaip_push_to_recs (struct aaip_state *aaip, unsigned char *data, size_t todo, int flag)
 
static int aaip_read_from_recs (struct aaip_state *aaip, size_t idx, unsigned char *data, size_t num_data, int flag)
 
static int aaip_set_buffer_byte (struct aaip_state *aaip, size_t idx, unsigned char data, int flag)
 
static int aaip_get_buffer_byte (struct aaip_state *aaip, size_t idx, int flag)
 
static int aaip_shift_recs (struct aaip_state *aaip, size_t todo, int flag)
 
static int aaip_consume_rec_head (struct aaip_state *aaip, unsigned char **data, size_t *num_data, int flag)
 
static int aaip_consume_rec_data (struct aaip_state *aaip, unsigned char **data, size_t *num_data, int flag)
 
static int aaip_consume_aa_head (struct aaip_state *aaip, unsigned char **data, size_t *num_data, int flag)
 
static int aaip_consume_aa_data (struct aaip_state *aaip, unsigned char **data, size_t *num_data, int flag)
 
int aaip_submit_data (struct aaip_state *aaip, unsigned char *data, size_t num_data, size_t *ready_bytes, int flag)
 
int aaip_fetch_data (struct aaip_state *aaip, char *result, size_t result_size, size_t *num_result, int flag)
 
int aaip_skip_component (struct aaip_state *aaip, int flag)
 
static int aaip_advance_pair (struct aaip_state *aaip, char *name, size_t name_size, size_t *name_fill, char *value, size_t value_size, size_t *value_fill, int flag)
 
int aaip_decode_pair (struct aaip_state *aaip, unsigned char *data, size_t num_data, size_t *consumed, char *name, size_t name_size, size_t *name_fill, char *value, size_t value_size, size_t *value_fill, int flag)
 
unsigned int aaip_get_pairs_skipped (struct aaip_state *aaip, int flag)
 
static int aaip_enlarge_buf (struct aaip_state *aaip, size_t memory_limit, size_t item_size, char **buf, size_t *buf_size, int flag)
 
int aaip_decode_attrs (struct aaip_state **handle, size_t memory_limit, size_t num_attr_limit, unsigned char *data, size_t num_data, size_t *consumed, int flag)
 
int aaip_get_decoded_attrs (struct aaip_state **handle, size_t *num_attrs, char ***names, size_t **value_lengths, char ***values, int flag)
 
static int aaip_write_acl_line (char **result, size_t *result_size, char *tag_type, char *qualifier, char *permissions, int flag)
 
static int aaip_read_qualifier (unsigned char *data, size_t num_data, char *name, size_t name_size, size_t *name_fill, int flag)
 
int aaip_decode_acl (unsigned char *data, size_t num_data, size_t *consumed, char *acl_text, size_t acl_text_size, size_t *acl_text_fill, int flag)
 

Variables

static char Aaip_namespace_textS [][9+1]
 

Macro Definition Documentation

◆ Aaip_ACL_GROUP

#define Aaip_ACL_GROUP   4

Definition at line 51 of file aaip_0_2.c.

◆ Aaip_ACL_GROUP_N

#define Aaip_ACL_GROUP_N   12

Definition at line 56 of file aaip_0_2.c.

◆ Aaip_ACL_GROUP_OBJ

#define Aaip_ACL_GROUP_OBJ   3

Definition at line 50 of file aaip_0_2.c.

◆ Aaip_ACL_MASK

#define Aaip_ACL_MASK   5

Definition at line 52 of file aaip_0_2.c.

◆ Aaip_ACL_OTHER

#define Aaip_ACL_OTHER   6

Definition at line 53 of file aaip_0_2.c.

◆ Aaip_ACL_USER

#define Aaip_ACL_USER   2

Definition at line 49 of file aaip_0_2.c.

◆ Aaip_ACL_USER_N

#define Aaip_ACL_USER_N   10

Definition at line 55 of file aaip_0_2.c.

◆ Aaip_ACL_USER_OBJ

#define Aaip_ACL_USER_OBJ   1

Definition at line 48 of file aaip_0_2.c.

◆ Aaip_buffer_reservE

#define Aaip_buffer_reservE   (257 + 3 * 2)

Definition at line 913 of file aaip_0_2.c.

◆ Aaip_buffer_sizE

#define Aaip_buffer_sizE   4096

Definition at line 908 of file aaip_0_2.c.

◆ Aaip_EXEC

#define Aaip_EXEC   1

Definition at line 43 of file aaip_0_2.c.

◆ Aaip_FUTURE_VERSION

#define Aaip_FUTURE_VERSION   15

Definition at line 57 of file aaip_0_2.c.

◆ Aaip_initial_list_sizE

#define Aaip_initial_list_sizE   2

Definition at line 1727 of file aaip_0_2.c.

◆ Aaip_initial_name_leN

#define Aaip_initial_name_leN   256

Definition at line 1725 of file aaip_0_2.c.

◆ Aaip_initial_value_leN

#define Aaip_initial_value_leN   256

Definition at line 1726 of file aaip_0_2.c.

◆ Aaip_list_enlargeR

#define Aaip_list_enlargeR   1.5

Definition at line 1728 of file aaip_0_2.c.

◆ Aaip_max_name_expansioN

#define Aaip_max_name_expansioN   9

Definition at line 72 of file aaip_0_2.c.

◆ Aaip_max_named_spacE

#define Aaip_max_named_spacE   0x06

Definition at line 60 of file aaip_0_2.c.

◆ Aaip_maxdef_namespacE

#define Aaip_maxdef_namespacE   0x1f

Definition at line 62 of file aaip_0_2.c.

◆ Aaip_min_named_spacE

#define Aaip_min_named_spacE   0x02

Definition at line 61 of file aaip_0_2.c.

◆ Aaip_namespace_isofS

#define Aaip_namespace_isofS   0x04

Definition at line 67 of file aaip_0_2.c.

◆ Aaip_namespace_literaL

#define Aaip_namespace_literaL   0x01

Definition at line 64 of file aaip_0_2.c.

◆ Aaip_namespace_securitY

#define Aaip_namespace_securitY   0x06

Definition at line 69 of file aaip_0_2.c.

◆ Aaip_namespace_systeM

#define Aaip_namespace_systeM   0x02

Definition at line 65 of file aaip_0_2.c.

◆ Aaip_namespace_trusteD

#define Aaip_namespace_trusteD   0x05

Definition at line 68 of file aaip_0_2.c.

◆ Aaip_namespace_useR

#define Aaip_namespace_useR   0x03

Definition at line 66 of file aaip_0_2.c.

◆ Aaip_READ

#define Aaip_READ   4

Definition at line 45 of file aaip_0_2.c.

◆ Aaip_SWITCH_MARK

#define Aaip_SWITCH_MARK   8

Definition at line 54 of file aaip_0_2.c.

◆ Aaip_TRANSLATE

#define Aaip_TRANSLATE   0

Definition at line 47 of file aaip_0_2.c.

◆ Aaip_with_ring_buffeR

#define Aaip_with_ring_buffeR   yes

Definition at line 1024 of file aaip_0_2.c.

◆ Aaip_with_short_namespaceS

#define Aaip_with_short_namespaceS   yes

Definition at line 59 of file aaip_0_2.c.

◆ Aaip_WRITE

#define Aaip_WRITE   2

Definition at line 44 of file aaip_0_2.c.

Function Documentation

◆ aaip_add_acl_st_mode()

int aaip_add_acl_st_mode ( char *  acl_text,
mode_t  st_mode,
int  flag 
)

Definition at line 865 of file aaip_0_2.c.

References aaip_cleanout_st_mode().

Referenced by iso_attr_get_acl_text().

◆ aaip_advance_pair()

static int aaip_advance_pair ( struct aaip_state aaip,
char *  name,
size_t  name_size,
size_t *  name_fill,
char *  value,
size_t  value_size,
size_t *  value_fill,
int  flag 
)
static

◆ aaip_cleanout_st_mode()

int aaip_cleanout_st_mode ( char *  acl_text,
mode_t *  in_st_mode,
int  flag 
)

◆ aaip_consume_aa_data()

◆ aaip_consume_aa_head()

static int aaip_consume_aa_head ( struct aaip_state aaip,
unsigned char **  data,
size_t *  num_data,
int  flag 
)
static

◆ aaip_consume_rec_data()

static int aaip_consume_rec_data ( struct aaip_state aaip,
unsigned char **  data,
size_t *  num_data,
int  flag 
)
static

◆ aaip_consume_rec_head()

static int aaip_consume_rec_head ( struct aaip_state aaip,
unsigned char **  data,
size_t *  num_data,
int  flag 
)
static

◆ aaip_count_bytes()

size_t aaip_count_bytes ( unsigned char *  data,
int  flag 
)

◆ aaip_decode_acl()

int aaip_decode_acl ( unsigned char *  data,
size_t  num_data,
size_t *  consumed,
char *  acl_text,
size_t  acl_text_size,
size_t *  acl_text_fill,
int  flag 
)

◆ aaip_decode_attrs()

◆ aaip_decode_pair()

int aaip_decode_pair ( struct aaip_state aaip,
unsigned char *  data,
size_t  num_data,
size_t *  consumed,
char *  name,
size_t  name_size,
size_t *  name_fill,
char *  value,
size_t  value_size,
size_t *  value_fill,
int  flag 
)

◆ aaip_encode()

ssize_t aaip_encode ( size_t  num_attrs,
char **  names,
size_t *  value_lengths,
char **  values,
size_t *  result_len,
unsigned char **  result,
int  flag 
)

Definition at line 100 of file aaip_0_2.c.

References aaip_encode_pair(), and ISO_OUT_OF_MEM.

Referenced by iso_node_set_attrs(), and lfs_get_aa_string().

◆ aaip_encode_acl()

int aaip_encode_acl ( char *  acl_text,
mode_t  st_mode,
size_t *  result_len,
unsigned char **  result,
int  flag 
)

Definition at line 292 of file aaip_0_2.c.

References aaip_encode_acl_text().

Referenced by aaip_encode_both_acl(), and aaip_get_attr_list().

◆ aaip_encode_acl_text()

static ssize_t aaip_encode_acl_text ( char *  acl_text,
mode_t  st_mode,
size_t  result_size,
unsigned char *  result,
int  flag 
)
static

◆ aaip_encode_both_acl()

int aaip_encode_both_acl ( char *  a_acl_text,
char *  d_acl_text,
mode_t  st_mode,
size_t *  result_len,
unsigned char **  result,
int  flag 
)

Definition at line 618 of file aaip_0_2.c.

References aaip_encode_acl().

Referenced by aaip_get_attr_list(), and iso_node_set_acl_text().

◆ aaip_encode_byte()

static void aaip_encode_byte ( unsigned char *  result,
size_t *  result_fill,
unsigned char  value 
)
static

Definition at line 185 of file aaip_0_2.c.

Referenced by aaip_encode_comp().

◆ aaip_encode_comp()

static int aaip_encode_comp ( unsigned char *  result,
size_t *  result_fill,
int  prefix,
char *  data,
size_t  l,
int  flag 
)
static

Definition at line 193 of file aaip_0_2.c.

References aaip_encode_byte().

Referenced by aaip_encode_pair().

◆ aaip_encode_pair()

static int aaip_encode_pair ( char *  name,
size_t  attr_length,
char *  attr,
unsigned int *  num_recs,
size_t *  comp_size,
unsigned char *  result,
size_t  result_fill,
int  flag 
)
static

◆ aaip_enlarge_buf()

static int aaip_enlarge_buf ( struct aaip_state aaip,
size_t  memory_limit,
size_t  item_size,
char **  buf,
size_t *  buf_size,
int  flag 
)
static

Definition at line 1735 of file aaip_0_2.c.

References Aaip_list_enlargeR, and aaip_state::list_mem_used.

Referenced by aaip_decode_attrs().

◆ aaip_fetch_data()

int aaip_fetch_data ( struct aaip_state aaip,
char *  result,
size_t  result_size,
size_t *  num_result,
int  flag 
)

◆ aaip_get_buffer_byte()

static int aaip_get_buffer_byte ( struct aaip_state aaip,
size_t  idx,
int  flag 
)
static

Definition at line 1116 of file aaip_0_2.c.

References aaip_ring_adr().

Referenced by aaip_consume_rec_head(), and aaip_fetch_data().

◆ aaip_get_decoded_attrs()

int aaip_get_decoded_attrs ( struct aaip_state **  handle,
size_t *  num_attrs,
char ***  names,
size_t **  value_lengths,
char ***  values,
int  flag 
)

◆ aaip_get_pairs_skipped()

unsigned int aaip_get_pairs_skipped ( struct aaip_state aaip,
int  flag 
)

Definition at line 1716 of file aaip_0_2.c.

References aaip_state::pairs_skipped.

◆ aaip_init_aaip_state()

◆ aaip_make_aaip_perms()

static int aaip_make_aaip_perms ( int  r,
int  w,
int  x 
)
static

Definition at line 343 of file aaip_0_2.c.

References Aaip_EXEC, Aaip_READ, and Aaip_WRITE.

Referenced by aaip_encode_acl_text().

◆ aaip_numeric_id()

static double aaip_numeric_id ( char *  name,
int  flag 
)
static

Definition at line 328 of file aaip_0_2.c.

Referenced by aaip_encode_acl_text().

◆ aaip_push_to_recs()

static int aaip_push_to_recs ( struct aaip_state aaip,
unsigned char *  data,
size_t  todo,
int  flag 
)
static

◆ aaip_read_from_recs()

static int aaip_read_from_recs ( struct aaip_state aaip,
size_t  idx,
unsigned char *  data,
size_t  num_data,
int  flag 
)
static

Definition at line 1087 of file aaip_0_2.c.

References aaip_ring_adr(), and aaip_state::recs.

Referenced by aaip_consume_aa_head(), and aaip_fetch_data().

◆ aaip_read_qualifier()

static int aaip_read_qualifier ( unsigned char *  data,
size_t  num_data,
char *  name,
size_t  name_size,
size_t *  name_fill,
int  flag 
)
static

Definition at line 2057 of file aaip_0_2.c.

Referenced by aaip_decode_acl().

◆ aaip_ring_adr()

static int aaip_ring_adr ( struct aaip_state aaip,
size_t  idx,
size_t  todo,
unsigned char **  start_pt,
size_t *  at_start_pt,
size_t *  at_recs,
int  flag 
)
static

◆ aaip_set_buffer_byte()

static int aaip_set_buffer_byte ( struct aaip_state aaip,
size_t  idx,
unsigned char  data,
int  flag 
)
static

Definition at line 1103 of file aaip_0_2.c.

References aaip_ring_adr().

Referenced by aaip_consume_aa_data().

◆ aaip_shift_recs()

static int aaip_shift_recs ( struct aaip_state aaip,
size_t  todo,
int  flag 
)
static

◆ aaip_sizeof_aaip_state()

size_t aaip_sizeof_aaip_state ( void  )

Definition at line 977 of file aaip_0_2.c.

◆ aaip_skip_component()

◆ aaip_submit_data()

int aaip_submit_data ( struct aaip_state aaip,
unsigned char *  data,
size_t  num_data,
size_t *  ready_bytes,
int  flag 
)

◆ aaip_write_acl_line()

static int aaip_write_acl_line ( char **  result,
size_t *  result_size,
char *  tag_type,
char *  qualifier,
char *  permissions,
int  flag 
)
static

Definition at line 2028 of file aaip_0_2.c.

Referenced by aaip_decode_acl().

Variable Documentation

◆ Aaip_namespace_textS

char Aaip_namespace_textS[][9+1]
static
Initial value:
=
{"", "", "system.", "user.", "isofs.", "trusted.", "security."}

Definition at line 74 of file aaip_0_2.c.

Referenced by aaip_decode_pair(), and aaip_encode_pair().