/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Rock Ridge extensions to the System Use Sharing protocol
* for the High Sierra filesystem
*/
#include <sys/pathname.h>
ulong_t *, int);
/*
* Signature table for RRIP
*/
};
/*
* rrip_dev_nodes()
*
* sig_handler() for RRIP signature "PN"
*
* This function parses out the major and minor numbers from the "PN
* " SUF.
*/
uchar_t *
{
}
/*
* rrip_file_attr()
*
* sig_handler() for RRIP signature "PX"
*
* This function parses out the file attributes of a file from the "PX"
* SUF. The attributes is finds are : st_mode, st_nlink, st_uid,
* and st_gid.
*/
uchar_t *
{
else
}
/*
* rrip_file_time()
*
* support function for rrip_file_time()
*
* This function decides whether to parse the times in a long time form
* (17 bytes) or a short time form (7 bytes). These time formats are
* defined in the ISO 9660 specification.
*/
static void
{
if (time_length == ISO_DATE_LEN)
else
}
/*
* rrip_file_time()
*
* sig_handler() for RRIP signature RRIP_TF
*
* This function parses out the file time attributes of a file from the
* "TI" SUF. The times it parses are : st_mtime, st_atime and st_ctime.
*
* The function form_time is a support function only used in this
* function.
*/
uchar_t *
{
}
}
}
}
/*
* name_parse()
*
* This is a generic fuction used for sym links and filenames. The
*
* The return value will be the NAME_CONTINUE or NAME_CHANGE value.
*
*/
static void
int rrip_flags, /* component/name flag */
int *dst_lenp, /* ptr to cur. str len */
int dst_size) /* limit dest string to */
/* this value */
{
dst[0] = 0;
SUA_string_len = 1;
}
SUA_string_len = 2;
}
/*
* XXX
* For now, ignore the following flags and return.
* have to figure out how to get host name in kernel.
* Unsure if this even should be done.
*/
"VOLUME ROOT and NAME_HOST currently unsupported\n");
return;
}
/*
* strlcat() has two nice properties:
* - the size of the output buffer includes the trailing '\0'
* - we pass "total size" not "remaining size"
* It'd be the ideal candidate for this codeblock - make it:
*
* strlcat(dst, SUA_string,
* MIN(dstsize, strlen(dst) + SUA_string_len + 1));
*
* Unfortunately, strlcat() cannot deal with input strings
* that are not NULL-terminated - like SUA_string can be in
* our case here. So we can't use it :(
* Now strncat() doesn't work either - because it doesn't deal
* with strings for which the 'potential NULL-termination' isn't
* accessible - strncat(dst, NULL, 0) crashes although it copies
* nothing in any case. If the SUA ends on a mapping boundary,
* then telling strncat() to copy no more than the remaining bytes
* in the buffer is of no avail if there's no NULL byte in them.
*
* Hence - binary copy. What are all these str* funcs for ??
*/
dst_size--; /* trailing '\0' */
else
}
/*
* rrip_name()
*
* sig_handler() for RRIP signature RRIP_NM
*
* This function handles the name of the current file. It is case
* sensitive to whatever was put into the field and does NO
* translation. It will take whatever characters were in the field.
*
* Because the flags effect the way the name is parsed the same way
* that the sym_link component parsing is done, we will use the same
* function to do the actual parsing.
*/
uchar_t *
{
goto end;
/*
* If we have a "." or ".." directory, we should not look for
* an alternate name
*/
goto end;
goto end;
}
}
end:
}
/*
* rrip_sym_link()
*
* sig_handler() for RRIP signature RRIP_SL
*
* creates a symlink buffer to simulate sym_links.
*/
uchar_t *
{
char *tmp_sym_link;
int sym_link_len;
char *sym_link;
goto end;
/*
* If the sym link has already been created, don't recreate it
*/
goto end;
/*
* If there is an original string put it into sym_link[], otherwise
* initialize sym_link[] to the empty string.
*/
} else {
sym_link[0] = '\0';
sym_link_len = 0;
}
/* for all components */
/*
* If the component is continued don't put a '/' in
* the pathname, but do NULL terminate it.
*/
} else {
/* add 1 to sym_link_len for '/' */
sym_link_len++;
}
}
/*
* If we reached the end of the symbolic link, take out the
* last slash, but don't change ROOT "/" to an empty string.
*/
/*
* if no memory has been allocated, get some, otherwise, append
* to the current allocation
*/
/* the size of a symlink is its length */
/* reached the end of the symbolic link */
}
end:
}
/*
* rrip_namecopy()
*
* This function will copy the rrip name to the "to" buffer, if it
* exists.
*
* XXX - We should speed this up by implementing the search in
* parse_sua(). It works right now, so I don't want to mess with it.
*/
int
char *from, /* name to copy */
char *to, /* string to copy "from" to */
char *tmp_name, /* temp storage for original name */
/* all that good info in */
{
int size = 0;
int change_flag = 0;
int ret_val;
return (0);
}
/* special handling for '.' and '..' */
return (1);
return (2);
}
}
return (size);
/*
* Well, the name was not found
*
* make rripname an upper case "nm" (to), so that
* we can compare it the current HDE_DIR_NAME()
* without nuking the original "nm", for future case
* sensitive name comparing
*/
return (-1);
}
/*
* rrip_reloc_dir()
*
* This function is fairly bogus. All it does is cause a failure of
* the hs_parsedir, so that no vnode will be made for it and
* essentially, the directory will no longer be seen. This is part
* of the directory hierarchy mess, where the relocated directory will
* be hidden as far as ISO 9660 is concerned. When we hit the child
* link "CL" SUF, then we will read the new directory.
*/
uchar_t *
{
}
/*
* rrip_child_link()
*
* This is the child link part of the directory hierarchy stuff and
* this does not really do much anyway. All it does is read the
* directory entry that the child link SUF contains. All should be
* fine then.
*/
uchar_t *
{
sig_args_p->flags = 0;
}
/*
* rrip_parent_link()
*
* This is the parent link part of the directory hierarchy stuff and
* this does not really do much anyway. All it does is read the
* directory entry that the parent link SUF contains. All should be
* fine then.
*/
uchar_t *
{
sig_args_p->flags = 0;
}
/*
* rrip_rock_ridge()
*
* This function is supposed to aid in speed of the filesystem.
*
* XXX - It is only here as a place holder so far.
*/
uchar_t *
{
}