From 52f01a0ff8f06ec1f15ab576867da3abf577e891 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 18 Mar 2015 17:49:12 +0100 Subject: [PATCH 001/109] Preliminary read side implementation of new permission handling. * acl.h (MAX_ACL_ENTRIES): Raise to 2730. Add comment to explain. * sec_acl.cc: Add leading comment to explain new ACL style. Add definitions and macros to use for bits in new Cygwin ACL. (DENY_RWX): New mask value for all temporary deny bits. (getace): Add bool parameter to decide when leaving all bits intact, rather than filtering them per the already set bits. (get_posix_access): New function, taking over functionality to read POSIX ACL from SECURITY_DESCRIPTOR. (getacl): Just call get_posix_access. * sec_helper.cc (well_known_cygwin_sid): Define. * security.cc (get_attribute_from_acl): Remove. (get_info_from_sd): Remove. (get_reg_sd): Call get_posix_access instead of get_info_from_sd. (get_file_attribute): Ditto. (get_object_attribute): Ditto. * security.h (well_known_cygwin_sid): Declare. (get_posix_access): Add prototype. * Throughout, use simpler ACE macros from Windows' accctrl.h. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 23 ++ winsup/cygwin/include/cygwin/acl.h | 12 +- winsup/cygwin/sec_acl.cc | 506 ++++++++++++++++++++--------- winsup/cygwin/sec_helper.cc | 11 +- winsup/cygwin/security.cc | 204 +----------- winsup/cygwin/security.h | 3 + 6 files changed, 399 insertions(+), 360 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index bd9e71ffa..5d45cdceb 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,26 @@ +2015-03-18 Corinna Vinschen + + Preliminary read side implementation of new permission handling. + * acl.h (MAX_ACL_ENTRIES): Raise to 2730. Add comment to explain. + * sec_acl.cc: Add leading comment to explain new ACL style. + Add definitions and macros to use for bits in new Cygwin ACL. + (DENY_RWX): New mask value for all temporary deny bits. + (getace): Add bool parameter to decide when leaving all bits intact, + rather than filtering them per the already set bits. + (get_posix_access): New function, taking over functionality to read + POSIX ACL from SECURITY_DESCRIPTOR. + (getacl): Just call get_posix_access. + * sec_helper.cc (well_known_cygwin_sid): Define. + * security.cc (get_attribute_from_acl): Remove. + (get_info_from_sd): Remove. + (get_reg_sd): Call get_posix_access instead of get_info_from_sd. + (get_file_attribute): Ditto. + (get_object_attribute): Ditto. + * security.h (well_known_cygwin_sid): Declare. + (get_posix_access): Add prototype. + + * Throughout, use simpler ACE macros from Windows' accctrl.h. + 2015-03-18 Corinna Vinschen * grp.cc (pwdgrp::parse_group): Call cygsid::getfromgr_passwd. diff --git a/winsup/cygwin/include/cygwin/acl.h b/winsup/cygwin/include/cygwin/acl.h index 8fa5a65a5..dcdfc0076 100644 --- a/winsup/cygwin/include/cygwin/acl.h +++ b/winsup/cygwin/include/cygwin/acl.h @@ -1,6 +1,6 @@ /* cygwin/acl.h header file for Cygwin. - Copyright 1999, 2000, 2001, 2002, 2010, 2014 Red Hat, Inc. + Copyright 1999, 2000, 2001, 2002, 2010, 2014, 2015 Red Hat, Inc. Written by C. Vinschen. This file is part of Cygwin. @@ -25,8 +25,16 @@ extern "C" { #define GETACL (0x1) #define GETACLCNT (0x2) +/* Windows ACLs have a maximum size of 64K. Counting the most pessimistic way, + the maximum number of ACEs is 3276. Technet claims "approximately 1820", + which uses the length of normal user and group SIDs for the computation. + We're now going with 2730, the number of aclent_t entries matching a 32K + buffer. + On one hand, there are only a limited number of SIDs shorter than the normal + user/group SIDs, on the other hand there are no deny aclent_t entries, so we + should be fine with 32K aclbuf_t buffers provided by the caller. */ #define MIN_ACL_ENTRIES (3) // minimal acl entries from GETACLCNT -#define MAX_ACL_ENTRIES (256) // max entries of each type +#define MAX_ACL_ENTRIES (2730) // max entries of each type // Return values of aclcheck(3) in case of error */ #define GRP_ERROR (0x1) diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index e5019cb35..a93e191ff 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -24,6 +24,64 @@ details. */ #include "ntdll.h" #include "tls_pbuf.h" +/* How does a correctly constructed new-style Windows ACL claiming to be a + POSIX ACL look like? + + - Cygwin ACE (special bits, CLASS_OBJ). + + - If a USER entry has more permissions than any group, Everyone, or if it + has more permissions than allowed by the CLASS_OBJ entry: + + USER deny ACEs == POSIX allow + & ^(mask | all group allows | Everyone allow) + + - USER_OBJ allow ACE + - USER allow ACEs + + The POSIX permissions returned for a USER entry are the allow bits alone! + + - If a GROUP entry has more permissions than Everyone, or if it has more + permissions than allowed by the CLASS_OBJ entry: + + GROUP deny ACEs == POSIX allow & ^(mask | Everyone allow) + + - GROUP_OBJ allow ACE + - GROUP allow ACEs + + The POSIX permissions returned for a GROUP entry are the allow bits alone! + + - OTHER_OBJ allow ACE + + Rinse and repeat for default ACEs with INHERIT flags set. + + - Default Cygwin ACE (S_ISGID, CLASS_OBJ). */ + + /* POSIX <-> Win32 */ + +/* Historically, these bits are stored in a NULL SID ACE. To distinguish + the new ACL style from the old one, we're now using an invented SID, the + Cygwin SID (S-1-0-1132029815). The new ACEs can exist twice in an ACL, + the "normal one" containg CLASS_OBJ and special bits, and the one with + INHERIT bit set to pass the DEF_CLASS_OBJ bits and the S_ISGID bit on. */ +#define CYG_ACE_ISVTX 0x001 /* 0x200 <-> 0x001 */ +#define CYG_ACE_ISGID 0x002 /* 0x400 <-> 0x002 */ +#define CYG_ACE_ISUID 0x004 /* 0x800 <-> 0x004 */ +#define CYG_ACE_ISBITS_TO_POSIX(val) \ + (((val) & 0x007) << 9) +#define CYG_ACE_ISBITS_TO_WIN(val) \ + (((val) & (S_ISVTX | S_ISUID | S_IS_GID)) >> 9) + +#define CYG_ACE_MASK_X 0x008 /* 0x001 <-> 0x008 */ +#define CYG_ACE_MASK_W 0x010 /* 0x002 <-> 0x010 */ +#define CYG_ACE_MASK_R 0x020 /* 0x004 <-> 0x020 */ +#define CYG_ACE_MASK_RWX 0x038 +#define CYG_ACE_MASK_VALID 0x040 /* has mask if set */ +#define CYG_ACE_MASK_TO_POSIX(val) \ + (((val) & CYG_ACE_MASK_RWX) >> 3) +#define CYG_ACE_MASK_TO_WIN(val) \ + ((((val) & S_IRWXO) << 3) \ + | CYG_ACE_MASK_VALID) + static int searchace (aclent_t *aclp, int nentries, int type, uid_t id = ILLEGAL_UID) { @@ -235,8 +293,7 @@ setacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp, allow |= FILE_DELETE_CHILD; /* Set inherit property. */ DWORD inheritance = (aclbufp[i].a_type & ACL_DEFAULT) - ? (CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE - | INHERIT_ONLY_ACE) + ? (SUB_CONTAINERS_AND_OBJECTS_INHERIT | INHERIT_ONLY) : NO_INHERITANCE; /* * If a specific acl contains a corresponding default entry with @@ -251,7 +308,7 @@ setacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp, ? aclbufp[i].a_id : ILLEGAL_UID)) >= 0 && aclbufp[i].a_perm == aclbufp[i + 1 + pos].a_perm) { - inheritance = CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE; + inheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT; /* invalidate the corresponding default entry. */ invalid[i + 1 + pos] = true; } @@ -337,15 +394,19 @@ setacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp, #define DENY_R 040000 #define DENY_W 020000 #define DENY_X 010000 +#define DENY_RWX (DENY_R | DENY_W | DENY_X) +/* New style ACL means, just read the bits and store them away. Don't + create masked values on your own. */ static void getace (aclent_t &acl, int type, int id, DWORD win_ace_mask, - DWORD win_ace_type) + DWORD win_ace_type, bool new_style) { acl.a_type = type; acl.a_id = id; - if ((win_ace_mask & FILE_READ_BITS) && !(acl.a_perm & (S_IROTH | DENY_R))) + if ((win_ace_mask & FILE_READ_BITS) + && (new_style || !(acl.a_perm & (S_IROTH | DENY_R)))) { if (win_ace_type == ACCESS_ALLOWED_ACE_TYPE) acl.a_perm |= S_IROTH; @@ -353,7 +414,8 @@ getace (aclent_t &acl, int type, int id, DWORD win_ace_mask, acl.a_perm |= DENY_R; } - if ((win_ace_mask & FILE_WRITE_BITS) && !(acl.a_perm & (S_IWOTH | DENY_W))) + if ((win_ace_mask & FILE_WRITE_BITS) + && (new_style || !(acl.a_perm & (S_IWOTH | DENY_W)))) { if (win_ace_type == ACCESS_ALLOWED_ACE_TYPE) acl.a_perm |= S_IWOTH; @@ -361,7 +423,8 @@ getace (aclent_t &acl, int type, int id, DWORD win_ace_mask, acl.a_perm |= DENY_W; } - if ((win_ace_mask & FILE_EXEC_BITS) && !(acl.a_perm & (S_IXOTH | DENY_X))) + if ((win_ace_mask & FILE_EXEC_BITS) + && (new_style || !(acl.a_perm & (S_IXOTH | DENY_X)))) { if (win_ace_type == ACCESS_ALLOWED_ACE_TYPE) acl.a_perm |= S_IXOTH; @@ -370,40 +433,92 @@ getace (aclent_t &acl, int type, int id, DWORD win_ace_mask, } } +/* From the SECURITY_DESCRIPTOR given in psd, compute user, owner, posix + attributes, as well as the POSIX acl. The function returns the number + of entries returned in aclbufp, or -1 in case of error. */ int -getacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp) +get_posix_access (PSECURITY_DESCRIPTOR psd, + mode_t *attr_ret, uid_t *uid_ret, gid_t *gid_ret, + aclent_t *aclbufp, int nentries) { - security_descriptor sd; - - if (get_file_sd (handle, pc, sd, false)) - return -1; - - cygpsid owner_sid; - cygpsid group_sid; + tmp_pathbuf tp; NTSTATUS status; - BOOLEAN dummy; + BOOLEAN dummy, acl_exists; + PACL acl; + PACCESS_ALLOWED_ACE ace; + cygpsid owner_sid, group_sid; + cyg_ldap cldap; uid_t uid; gid_t gid; - cyg_ldap cldap; + mode_t attr = 0; + aclent_t *lacl = NULL; + cygpsid ace_sid; + int pos, type, id; - status = RtlGetOwnerSecurityDescriptor (sd, (PSID *) &owner_sid, &dummy); + bool new_style = false; + int types_def = 0; + int def_pgrp_pos = -1; + bool has_class_perm = false, has_def_class_perm = false; + mode_t class_perm = 0, def_class_perm = 0; + + if (aclbufp && nentries < MIN_ACL_ENTRIES) + { + set_errno (EINVAL); + return -1; + } + /* If reading the security descriptor failed, treat the object as + unreadable. */ + if (!psd) + { + if (attr_ret) + *attr_ret &= S_IFMT; + if (uid_ret) + *uid_ret = ILLEGAL_UID; + if (gid_ret) + *gid_ret = ILLEGAL_GID; + if (aclbufp) + { + aclbufp[0].a_type = USER_OBJ; + aclbufp[0].a_id = ILLEGAL_UID; + aclbufp[0].a_perm = 0; + aclbufp[1].a_type = GROUP_OBJ; + aclbufp[1].a_id = ILLEGAL_GID; + aclbufp[1].a_perm = 0; + aclbufp[2].a_type = OTHER_OBJ; + aclbufp[2].a_id = ILLEGAL_GID; + aclbufp[2].a_perm = 0; + return MIN_ACL_ENTRIES; + } + return 0; + } + /* Fetch owner, group, and ACL from security descriptor. */ + status = RtlGetOwnerSecurityDescriptor (psd, (PSID *) &owner_sid, &dummy); if (!NT_SUCCESS (status)) { __seterrno_from_nt_status (status); return -1; } + status = RtlGetGroupSecurityDescriptor (psd, (PSID *) &group_sid, &dummy); + if (!NT_SUCCESS (status)) + { + __seterrno_from_nt_status (status); + return -1; + } + status = RtlGetDaclSecurityDescriptor (psd, &acl_exists, &acl, &dummy); + if (!NT_SUCCESS (status)) + { + __seterrno_from_nt_status (status); + return -1; + } + /* Set uidret, gidret, and initalize attributes. */ uid = owner_sid.get_uid (&cldap); - - status = RtlGetGroupSecurityDescriptor (sd, (PSID *) &group_sid, &dummy); - if (!NT_SUCCESS (status)) - { - __seterrno_from_nt_status (status); - return -1; - } gid = group_sid.get_gid (&cldap); + if (attr_ret) + attr |= (*attr_ret & S_IFMT); - aclent_t lacl[MAX_ACL_ENTRIES]; - memset (&lacl, 0, MAX_ACL_ENTRIES * sizeof (aclent_t)); + /* Create and initialize local aclent_t array. */ + lacl = (aclent_t *) tp.c_get (); + memset (lacl, 0, MAX_ACL_ENTRIES * sizeof (aclent_t *)); lacl[0].a_type = USER_OBJ; lacl[0].a_id = uid; lacl[1].a_type = GROUP_OBJ; @@ -411,102 +526,127 @@ getacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp) lacl[2].a_type = OTHER_OBJ; lacl[2].a_id = ILLEGAL_GID; - PACL acl; - BOOLEAN acl_exists; - - status = RtlGetDaclSecurityDescriptor (sd, &acl_exists, &acl, &dummy); - if (!NT_SUCCESS (status)) + /* No ACEs? Everybody has full access. */ + if (!acl_exists || !acl || acl->AceCount == 0) { - __seterrno_from_nt_status (status); - return -1; + for (pos = 0; pos < MIN_ACL_ENTRIES; ++pos) + lacl[pos].a_perm = S_IROTH | S_IWOTH | S_IXOTH; + goto out; } - int pos, i, types_def = 0; - int pgrp_pos = 1, def_pgrp_pos = -1; - bool has_class_perm = false, has_def_class_perm = false; - mode_t class_perm = 0, def_class_perm = 0; - - if (!acl_exists || !acl) - for (pos = 0; pos < 3; ++pos) - lacl[pos].a_perm = S_IROTH | S_IWOTH | S_IXOTH; - else + for (int i = 0; i < acl->AceCount; ++i) { - for (i = 0; i < acl->AceCount; ++i) + if (!NT_SUCCESS (RtlGetAce (acl, i, (PVOID *) &ace))) + continue; + + ace_sid = (PSID) &ace->SidStart; + + if (ace_sid == well_known_null_sid) { - ACCESS_ALLOWED_ACE *ace; - - if (!NT_SUCCESS (RtlGetAce (acl, i, (PVOID *) &ace))) - continue; - - cygpsid ace_sid ((PSID) &ace->SidStart); - int id; - int type = 0; - - if (ace_sid == well_known_null_sid) + /* Old-style or non-Cygwin ACL. Fetch only the special bits. */ + attr |= CYG_ACE_ISBITS_TO_POSIX (ace->Mask); + continue; + } + if (ace_sid == well_known_cygwin_sid) + { + /* New-style ACL. Note the fact that a mask value is present since + that changes how getace fetches the information. That's fine, + because the Cygwin SID ACE is supposed to precede all USER, GROUP + and GROUP_OBJ entries. Any ACL not created that way has been + rearranged by the Windows functionality to create the brain-dead + "canonical" ACL order and is broken anyway. */ + attr |= CYG_ACE_ISBITS_TO_POSIX (ace->Mask); + if (ace->Mask & CYG_ACE_MASK_VALID) { - /* Simply ignore. */ - continue; + new_style = true; + type = (ace->Header.AceFlags & SUB_CONTAINERS_AND_OBJECTS_INHERIT) + ? DEF_CLASS_OBJ : CLASS_OBJ; + if ((pos = searchace (lacl, MAX_ACL_ENTRIES, type, ILLEGAL_GID)) + >= 0) + { + lacl[pos].a_type = type; + lacl[pos].a_id = ILLEGAL_GID; + lacl[pos].a_perm = CYG_ACE_MASK_TO_POSIX (ace->Mask); + } + if (type == CLASS_OBJ) /* Needed for POSIX permissions. */ + { + has_class_perm = true; + class_perm = lacl[pos].a_perm; + } + else + { + has_def_class_perm = true; + def_class_perm = lacl[pos].a_perm; + } } - if (ace_sid == well_known_world_sid) - { - type = OTHER_OBJ; - id = ILLEGAL_GID; - } - else if (ace_sid == owner_sid) - { - type = USER_OBJ; - id = uid; - } - else if (ace_sid == group_sid) - { - type = GROUP_OBJ; - id = gid; - } - else if (ace_sid == well_known_creator_group_sid) - { - type = DEF_GROUP_OBJ; - types_def |= type; - id = ILLEGAL_GID; - } - else if (ace_sid == well_known_creator_owner_sid) - { - type = DEF_USER_OBJ; - types_def |= type; - id = ILLEGAL_GID; - } - else - id = ace_sid.get_id (TRUE, &type, &cldap); - + continue; + } + else if (ace_sid == owner_sid) + { + type = USER_OBJ; + id = uid; + } + else if (ace_sid == group_sid) + { + type = GROUP_OBJ; + id = gid; + } + else if (ace_sid == well_known_world_sid) + { + type = OTHER_OBJ; + id = ILLEGAL_GID; + } + else if (ace_sid == well_known_creator_owner_sid) + { + type = DEF_USER_OBJ; + types_def |= type; + id = ILLEGAL_GID; + } + else if (ace_sid == well_known_creator_group_sid) + { + type = DEF_GROUP_OBJ; + types_def |= type; + id = ILLEGAL_GID; + } + else + { + id = ace_sid.get_id (TRUE, &type, &cldap); if (!type) continue; - if (!(ace->Header.AceFlags & INHERIT_ONLY_ACE || type & ACL_DEFAULT)) + } + if (!(ace->Header.AceFlags & INHERIT_ONLY || type & ACL_DEFAULT)) + { + if ((pos = searchace (lacl, MAX_ACL_ENTRIES, type, id)) >= 0) { - if ((pos = searchace (lacl, MAX_ACL_ENTRIES, type, id)) >= 0) + getace (lacl[pos], type, id, ace->Mask, ace->Header.AceType, + new_style && type & (USER | GROUP)); + if (!new_style) { - getace (lacl[pos], type, id, ace->Mask, ace->Header.AceType); /* Fix up CLASS_OBJ value. */ - if (type == USER || type == GROUP) + if (type & (USER | GROUP)) { has_class_perm = true; class_perm |= lacl[pos].a_perm; } } } - if ((ace->Header.AceFlags - & (CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE)) - && pc.isdir ()) + } + if ((ace->Header.AceFlags & SUB_CONTAINERS_AND_OBJECTS_INHERIT)) + { + if (type == USER_OBJ) + type = USER; + else if (type == GROUP_OBJ) + type = GROUP; + type |= ACL_DEFAULT; + types_def |= type; + if ((pos = searchace (lacl, MAX_ACL_ENTRIES, type, id)) >= 0) { - if (type == USER_OBJ) - type = USER; - else if (type == GROUP_OBJ) - type = GROUP; - type |= ACL_DEFAULT; - types_def |= type; - if ((pos = searchace (lacl, MAX_ACL_ENTRIES, type, id)) >= 0) + getace (lacl[pos], type, id, ace->Mask, ace->Header.AceType, + new_style && type & (USER | GROUP)); + if (!new_style) { - getace (lacl[pos], type, id, ace->Mask, ace->Header.AceType); /* Fix up DEF_CLASS_OBJ value. */ - if (type == DEF_USER || type == DEF_GROUP) + if (type & (USER | GROUP)) { has_def_class_perm = true; def_class_perm |= lacl[pos].a_perm; @@ -517,80 +657,134 @@ getacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp) } } } - /* If secondary user and group entries exist in the ACL, fake a matching - CLASS_OBJ entry. The CLASS_OBJ permissions are the or'ed permissions - of the primary group permissions and all secondary user and group - permissions. */ - if (has_class_perm && (pos = searchace (lacl, MAX_ACL_ENTRIES, 0)) >= 0) + } + /* If this is an old-style or non-Cygwin ACL, and secondary user and group + entries exist in the ACL, fake a matching CLASS_OBJ entry. The CLASS_OBJ + permissions are the or'ed permissions of the primary group permissions + and all secondary user and group permissions. */ + if (!new_style && has_class_perm + && (pos = searchace (lacl, MAX_ACL_ENTRIES, 0)) >= 0) + { + lacl[pos].a_type = CLASS_OBJ; + lacl[pos].a_id = ILLEGAL_GID; + lacl[pos].a_perm = class_perm | lacl[1].a_perm; + } + /* Ensure that the default acl contains at least + DEF_(USER|GROUP|OTHER)_OBJ entries. */ + if (types_def && (pos = searchace (lacl, MAX_ACL_ENTRIES, 0)) >= 0) + { + if (!(types_def & USER_OBJ)) { - lacl[pos].a_type = CLASS_OBJ; - lacl[pos].a_id = ILLEGAL_GID; - lacl[pos].a_perm = class_perm | lacl[pgrp_pos].a_perm; + lacl[pos].a_type = DEF_USER_OBJ; + lacl[pos].a_id = uid; + lacl[pos].a_perm = lacl[0].a_perm; + pos++; } - /* Ensure that the default acl contains at least - DEF_(USER|GROUP|OTHER)_OBJ entries. */ - if (types_def && (pos = searchace (lacl, MAX_ACL_ENTRIES, 0)) >= 0) + if (!(types_def & GROUP_OBJ) && pos < MAX_ACL_ENTRIES) { - if (!(types_def & USER_OBJ)) - { - lacl[pos].a_type = DEF_USER_OBJ; - lacl[pos].a_id = uid; - lacl[pos].a_perm = lacl[0].a_perm; - pos++; - } - if (!(types_def & GROUP_OBJ) && pos < MAX_ACL_ENTRIES) - { - lacl[pos].a_type = DEF_GROUP_OBJ; - lacl[pos].a_id = gid; - lacl[pos].a_perm = lacl[1].a_perm; - /* Note the position of the DEF_GROUP_OBJ entry. */ - def_pgrp_pos = pos; - pos++; - } - if (!(types_def & OTHER_OBJ) && pos < MAX_ACL_ENTRIES) - { - lacl[pos].a_type = DEF_OTHER_OBJ; - lacl[pos].a_id = ILLEGAL_GID; - lacl[pos].a_perm = lacl[2].a_perm; - pos++; - } + lacl[pos].a_type = DEF_GROUP_OBJ; + lacl[pos].a_id = gid; + lacl[pos].a_perm = lacl[1].a_perm; + /* Note the position of the DEF_GROUP_OBJ entry. */ + def_pgrp_pos = pos; + pos++; } - /* If secondary user default and group default entries exist in the ACL, - fake a matching DEF_CLASS_OBJ entry. The DEF_CLASS_OBJ permissions are - the or'ed permissions of the primary group default permissions and all - secondary user and group default permissions. */ - if (has_def_class_perm - && (pos = searchace (lacl, MAX_ACL_ENTRIES, 0)) >= 0) + if (!(types_def & OTHER_OBJ) && pos < MAX_ACL_ENTRIES) { - lacl[pos].a_type = DEF_CLASS_OBJ; + lacl[pos].a_type = DEF_OTHER_OBJ; lacl[pos].a_id = ILLEGAL_GID; - lacl[pos].a_perm = def_class_perm; - if (def_pgrp_pos >= 0) - lacl[pos].a_perm |= lacl[def_pgrp_pos].a_perm; + lacl[pos].a_perm = lacl[2].a_perm; + pos++; } } + /* If this is an old-style or non-Cygwin ACL, and secondary user default + and group default entries exist in the ACL, fake a matching DEF_CLASS_OBJ + entry. The DEF_CLASS_OBJ permissions are the or'ed permissions of the + primary group default permissions and all secondary user and group def. + permissions. */ + if (!new_style && has_def_class_perm + && (pos = searchace (lacl, MAX_ACL_ENTRIES, 0)) >= 0) + { + lacl[pos].a_type = DEF_CLASS_OBJ; + lacl[pos].a_id = ILLEGAL_GID; + lacl[pos].a_perm = def_class_perm; + if (def_pgrp_pos >= 0) + lacl[pos].a_perm |= lacl[def_pgrp_pos].a_perm; + } + + /* Make sure `pos' contains the number of used entries in lacl. */ if ((pos = searchace (lacl, MAX_ACL_ENTRIES, 0)) < 0) pos = MAX_ACL_ENTRIES; + + /* For old-style or non-Cygwin ACLs, check for merging permissions. */ + if (!new_style) + for (int i = 0; i < pos; ++i) + { + /* Current user? If the user entry has a deny ACE, don't check. */ + if (lacl[i].a_id == myself->uid + && lacl[i].a_type & (USER_OBJ | USER) + && !(lacl[i].a_type & ACL_DEFAULT) + && !(lacl[i].a_perm & DENY_RWX)) + { + int gpos; + gid_t grps[NGROUPS_MAX]; + cyg_ldap cldap; + + /* Sum up all permissions of groups the user is member of, plus + everyone perms, and merge them to user perms. */ + mode_t grp_perm = lacl[2].a_perm & S_IRWXO; + int gnum = internal_getgroups (NGROUPS_MAX, grps, &cldap); + for (int g = 0; g < gnum && grp_perm != S_IRWXO; ++g) + if ((gpos = 1, grps[g] == lacl[gpos].a_id) + || (gpos = searchace (lacl, MAX_ACL_ENTRIES, GROUP, grps[g])) + >= 0) + grp_perm |= lacl[gpos].a_perm & S_IRWXO; + lacl[i].a_perm |= grp_perm; + } + /* For all groups, if everyone has more permissions, add everyone + perms to group perms. Skip groups with deny ACE. */ + else if (lacl[i].a_id & (GROUP_OBJ | GROUP) + && !(lacl[i].a_type & ACL_DEFAULT) + && !(lacl[i].a_perm & DENY_RWX)) + lacl[i].a_perm |= lacl[2].a_perm & S_IRWXO; + } + /* Construct POSIX permission bits. Fortunately we know exactly where + to fetch the affecting bits from, at least as long as the array + hasn't been sorted. */ + attr |= (lacl[0].a_perm & S_IRWXO) << 6; + attr |= (has_class_perm ? class_perm : (lacl[1].a_perm & S_IRWXO)) << 3; + attr |= (lacl[2].a_perm & S_IRWXO); + +out: + if (uid_ret) + *uid_ret = uid; + if (gid_ret) + *gid_ret = gid; + if (attr_ret) + *attr_ret = attr; if (aclbufp) { -#if 0 - /* Disable owner/group permissions equivalence if owner SID == group SID. - It's technically not quite correct, but it helps in case a security - conscious application checks if a file has too open permissions. In - fact, since owner == group, there's no security issue here. */ - if (owner_sid == group_sid) - lacl[1].a_perm = lacl[0].a_perm; -#endif if (pos > nentries) { set_errno (ENOSPC); return -1; } memcpy (aclbufp, lacl, pos * sizeof (aclent_t)); - for (i = 0; i < pos; ++i) - aclbufp[i].a_perm &= ~(DENY_R | DENY_W | DENY_X); + for (int i = 0; i < pos; ++i) + aclbufp[i].a_perm &= S_IRWXO; aclsort32 (pos, 0, aclbufp); } + return pos; +} + +int +getacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp) +{ + security_descriptor sd; + + if (get_file_sd (handle, pc, sd, false)) + return -1; + int pos = get_posix_access (sd, NULL, NULL, NULL, aclbufp, nentries); syscall_printf ("%R = getacl(%S)", pos, pc.get_nt_native_path ()); return pos; } diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc index 679f3a858..1ea69c372 100644 --- a/winsup/cygwin/sec_helper.cc +++ b/winsup/cygwin/sec_helper.cc @@ -40,6 +40,8 @@ SECURITY_ATTRIBUTES NO_COPY_RO sec_all_nih = MKSID (well_known_null_sid, "S-1-0-0", SECURITY_NULL_SID_AUTHORITY, 1, SECURITY_NULL_RID); +MKSID (well_known_cygwin_sid, "S-1-0-1132029815", + SECURITY_NULL_SID_AUTHORITY, 1, 0x43796777); /* "Cygw" */ MKSID (well_known_world_sid, "S-1-1-0", SECURITY_WORLD_SID_AUTHORITY, 1, SECURITY_WORLD_RID); MKSID (well_known_local_sid, "S-1-2-0", @@ -616,22 +618,21 @@ _recycler_sd (void *buf, bool users, bool dir) pre-Vista permissions the same way as on Vista and later. */ RtlCreateAcl (dacl, MAX_DACL_LEN (3), ACL_REVISION); RtlAddAccessAllowedAceEx (dacl, ACL_REVISION, - dir ? CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE + dir ? SUB_CONTAINERS_AND_OBJECTS_INHERIT : NO_INHERITANCE, FILE_ALL_ACCESS, well_known_admins_sid); RtlAddAccessAllowedAceEx (dacl, ACL_REVISION, - dir ? CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE + dir ? SUB_CONTAINERS_AND_OBJECTS_INHERIT : NO_INHERITANCE, FILE_ALL_ACCESS, well_known_system_sid); if (users) - RtlAddAccessAllowedAceEx (dacl, ACL_REVISION, NO_PROPAGATE_INHERIT_ACE, + RtlAddAccessAllowedAceEx (dacl, ACL_REVISION, INHERIT_NO_PROPAGATE, FILE_GENERIC_READ | FILE_GENERIC_EXECUTE | FILE_APPEND_DATA | FILE_WRITE_ATTRIBUTES, well_known_users_sid); else RtlAddAccessAllowedAceEx (dacl, ACL_REVISION, - dir ? CONTAINER_INHERIT_ACE - | OBJECT_INHERIT_ACE + dir ? SUB_CONTAINERS_AND_OBJECTS_INHERIT : NO_INHERITANCE, FILE_ALL_ACCESS, cygheap->user.sid ()); LPVOID ace; diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 1bc0c5047..e6cbd4cd5 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -234,194 +234,6 @@ set_file_sd (HANDLE fh, path_conv &pc, security_descriptor &sd, bool is_chown) return res; } -static void -get_attribute_from_acl (mode_t *attribute, PACL acl, PSID owner_sid, - PSID group_sid, bool grp_member) -{ - ACCESS_ALLOWED_ACE *ace; - mode_t allow = 0; - mode_t deny = 0; - mode_t *flags, *anti; - bool isownergroup = RtlEqualSid (owner_sid, group_sid); - - for (DWORD i = 0; i < acl->AceCount; ++i) - { - if (!NT_SUCCESS (RtlGetAce (acl, i, (PVOID *) &ace))) - continue; - if (ace->Header.AceFlags & INHERIT_ONLY_ACE) - continue; - switch (ace->Header.AceType) - { - case ACCESS_ALLOWED_ACE_TYPE: - flags = &allow; - anti = &deny; - break; - case ACCESS_DENIED_ACE_TYPE: - flags = &deny; - anti = &allow; - break; - default: - continue; - } - - cygpsid ace_sid ((PSID) &ace->SidStart); - if (ace_sid == well_known_world_sid) - { - if (ace->Mask & FILE_READ_BITS) - *flags |= ((!(*anti & S_IROTH)) ? S_IROTH : 0) - | ((!isownergroup && !(*anti & S_IRGRP)) ? S_IRGRP : 0) - | ((!(*anti & S_IRUSR)) ? S_IRUSR : 0); - if (ace->Mask & FILE_WRITE_BITS) - *flags |= ((!(*anti & S_IWOTH)) ? S_IWOTH : 0) - | ((!isownergroup && !(*anti & S_IWGRP)) ? S_IWGRP : 0) - | ((!(*anti & S_IWUSR)) ? S_IWUSR : 0); - if (ace->Mask & FILE_EXEC_BITS) - *flags |= ((!(*anti & S_IXOTH)) ? S_IXOTH : 0) - | ((!isownergroup && !(*anti & S_IXGRP)) ? S_IXGRP : 0) - | ((!(*anti & S_IXUSR)) ? S_IXUSR : 0); - if ((S_ISDIR (*attribute)) && - (ace->Mask & (FILE_WRITE_DATA | FILE_EXECUTE | FILE_DELETE_CHILD)) - == (FILE_WRITE_DATA | FILE_EXECUTE)) - *flags |= S_ISVTX; - } - else if (ace_sid == well_known_null_sid) - { - /* Read SUID, SGID and VTX bits from NULL ACE. */ - if (ace->Mask & FILE_READ_DATA) - *flags |= S_ISVTX; - if (ace->Mask & FILE_WRITE_DATA) - *flags |= S_ISGID; - if (ace->Mask & FILE_APPEND_DATA) - *flags |= S_ISUID; - } - else if (ace_sid == owner_sid) - { - if (ace->Mask & FILE_READ_BITS) - *flags |= ((!(*anti & S_IRUSR)) ? S_IRUSR : 0); - if (ace->Mask & FILE_WRITE_BITS) - *flags |= ((!(*anti & S_IWUSR)) ? S_IWUSR : 0); - if (ace->Mask & FILE_EXEC_BITS) - *flags |= ((!(*anti & S_IXUSR)) ? S_IXUSR : 0); - /* Apply deny mask to group if group SID == owner SID. */ - if (group_sid && isownergroup - && ace->Header.AceType == ACCESS_DENIED_ACE_TYPE) - { - if (ace->Mask & FILE_READ_BITS) - *flags |= ((!(*anti & S_IRUSR)) ? S_IRGRP : 0); - if (ace->Mask & FILE_WRITE_BITS) - *flags |= ((!(*anti & S_IWUSR)) ? S_IWGRP : 0); - if (ace->Mask & FILE_EXEC_BITS) - *flags |= ((!(*anti & S_IXUSR)) ? S_IXGRP : 0); - } - } - else if (ace_sid == group_sid) - { - if (ace->Mask & FILE_READ_BITS) - *flags |= ((!(*anti & S_IRGRP)) ? S_IRGRP : 0) - | ((grp_member && !(*anti & S_IRUSR)) ? S_IRUSR : 0); - if (ace->Mask & FILE_WRITE_BITS) - *flags |= ((!(*anti & S_IWGRP)) ? S_IWGRP : 0) - | ((grp_member && !(*anti & S_IWUSR)) ? S_IWUSR : 0); - if (ace->Mask & FILE_EXEC_BITS) - *flags |= ((!(*anti & S_IXGRP)) ? S_IXGRP : 0) - | ((grp_member && !(*anti & S_IXUSR)) ? S_IXUSR : 0); - } - else if (flags == &allow) - { - /* Simplified computation of additional group permissions based on - the CLASS_OBJ value. CLASS_OBJ represents the or'ed value of - the primary group permissions and all secondary user and group - permissions. FIXME: This only takes ACCESS_ALLOWED_ACEs into - account. The computation with additional ACCESS_DENIED_ACE - handling is much more complicated. */ - if (ace->Mask & FILE_READ_BITS) - *flags |= S_IRGRP; - if (ace->Mask & FILE_WRITE_BITS) - *flags |= S_IWGRP; - if (ace->Mask & FILE_EXEC_BITS) - *flags |= S_IXGRP; - } - } - *attribute &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISVTX | S_ISGID | S_ISUID); -#if 0 - /* Disable owner/group permissions equivalence if owner SID == group SID. - It's technically not quite correct, but it helps in case a security - conscious application checks if a file has too open permissions. In - fact, since owner == group, there's no security issue here. */ - if (owner_sid && group_sid && RtlEqualSid (owner_sid, group_sid) - /* FIXME: temporary exception for /var/empty */ - && well_known_system_sid != group_sid) - { - allow &= ~(S_IRGRP | S_IWGRP | S_IXGRP); - allow |= (((allow & S_IRUSR) ? S_IRGRP : 0) - | ((allow & S_IWUSR) ? S_IWGRP : 0) - | ((allow & S_IXUSR) ? S_IXGRP : 0)); - } -#endif - *attribute |= allow; -} - -static void -get_info_from_sd (PSECURITY_DESCRIPTOR psd, mode_t *attribute, - uid_t *uidret, gid_t *gidret) -{ - if (!psd) - { - /* If reading the security descriptor failed, treat the object - as unreadable. */ - if (attribute) - *attribute &= ~(S_IRWXU | S_IRWXG | S_IRWXO); - if (uidret) - *uidret = ILLEGAL_UID; - if (gidret) - *gidret = ILLEGAL_GID; - return; - } - - cygpsid owner_sid; - cygpsid group_sid; - NTSTATUS status; - BOOLEAN dummy; - - status = RtlGetOwnerSecurityDescriptor (psd, (PSID *) &owner_sid, &dummy); - if (!NT_SUCCESS (status)) - debug_printf ("RtlGetOwnerSecurityDescriptor: %y", status); - status = RtlGetGroupSecurityDescriptor (psd, (PSID *) &group_sid, &dummy); - if (!NT_SUCCESS (status)) - debug_printf ("RtlGetGroupSecurityDescriptor: %y", status); - - uid_t uid; - gid_t gid; - bool grp_member = get_sids_info (owner_sid, group_sid, &uid, &gid); - if (uidret) - *uidret = uid; - if (gidret) - *gidret = gid; - - if (!attribute) - { - syscall_printf ("uid %u, gid %u", uid, gid); - return; - } - - PACL acl; - BOOLEAN acl_exists; - - status = RtlGetDaclSecurityDescriptor (psd, &acl_exists, &acl, &dummy); - if (!NT_SUCCESS (status)) - { - __seterrno_from_nt_status (status); - *attribute &= ~(S_IRWXU | S_IRWXG | S_IRWXO); - } - else if (!acl_exists || !acl) - *attribute |= S_IRWXU | S_IRWXG | S_IRWXO; - else - get_attribute_from_acl (attribute, acl, owner_sid, group_sid, grp_member); - - syscall_printf ("%sACL %y, uid %u, gid %u", - (!acl_exists || !acl)?"NO ":"", *attribute, uid, gid); -} - static int get_reg_sd (HANDLE handle, security_descriptor &sd_ret) { @@ -454,7 +266,7 @@ get_reg_attribute (HKEY hkey, mode_t *attribute, uid_t *uidret, if (!get_reg_sd (hkey, sd)) { - get_info_from_sd (sd, attribute, uidret, gidret); + get_posix_access (sd, attribute, uidret, gidret, NULL, 0); return 0; } /* The entries are already set to default values */ @@ -471,7 +283,7 @@ get_file_attribute (HANDLE handle, path_conv &pc, if (!get_file_sd (handle, pc, sd, false)) { - get_info_from_sd (sd, attribute, uidret, gidret); + get_posix_access (sd, attribute, uidret, gidret, NULL, 0); return 0; } /* ENOSYS is returned by get_file_sd if fetching the DACL from a remote @@ -773,10 +585,10 @@ alloc_sd (path_conv &pc, uid_t uid, gid_t gid, int attribute, { if ((S_ISDIR (attribute) && (attribute & S_JUSTCREATED)) || (ace->Header.AceFlags - & (CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE)) == 0) + & (SUB_CONTAINERS_AND_OBJECTS_INHERIT)) == 0) continue; else - ace->Header.AceFlags |= INHERIT_ONLY_ACE; + ace->Header.AceFlags |= INHERIT_ONLY; } if (attribute & S_JUSTCREATED) { @@ -797,8 +609,7 @@ alloc_sd (path_conv &pc, uid_t uid, gid_t gid, int attribute, it inherits the default ACL from its parent, so mark all unrelated, inherited ACEs inheritable. */ if (S_ISDIR (attribute)) - ace->Header.AceFlags |= CONTAINER_INHERIT_ACE - | OBJECT_INHERIT_ACE; + ace->Header.AceFlags |= SUB_CONTAINERS_AND_OBJECTS_INHERIT; } else if (uid == ILLEGAL_UID && gid == ILLEGAL_UID && ace->Header.AceType == ACCESS_ALLOWED_ACE_TYPE @@ -835,8 +646,7 @@ alloc_sd (path_conv &pc, uid_t uid, gid_t gid, int attribute, Cygwin applications don't need this. */ if (S_ISDIR (attribute) && (attribute & S_JUSTCREATED)) { - const DWORD inherit = CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE - | INHERIT_ONLY_ACE; + const DWORD inherit = SUB_CONTAINERS_AND_OBJECTS_INHERIT | INHERIT_ONLY; /* Set allow ACE for owner. */ if (!add_access_allowed_ace (acl, ace_off++, owner_allow, well_known_creator_owner_sid, acl_len, @@ -936,7 +746,7 @@ get_object_attribute (HANDLE handle, uid_t *uidret, gid_t *gidret, if (get_object_sd (handle, sd)) return -1; - get_info_from_sd (sd, attribute, uidret, gidret); + get_posix_access (sd, attribute, uidret, gidret, NULL, 0); return 0; } diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h index 867345774..9457eba6b 100644 --- a/winsup/cygwin/security.h +++ b/winsup/cygwin/security.h @@ -393,6 +393,7 @@ public: }; extern cygpsid well_known_null_sid; +extern cygpsid well_known_cygwin_sid; extern cygpsid well_known_world_sid; extern cygpsid well_known_local_sid; extern cygpsid well_known_console_logon_sid; @@ -463,6 +464,8 @@ bool get_sids_info (cygpsid, cygpsid, uid_t * , gid_t *); struct acl; extern "C" int aclsort32 (int, int, struct acl *); extern "C" int acl32 (const char *, int, int, struct acl *); +int get_posix_access (PSECURITY_DESCRIPTOR, mode_t *, uid_t *, gid_t *, + struct acl *, int); int getacl (HANDLE, path_conv &, int, struct acl *); int setacl (HANDLE, path_conv &, int, struct acl *, bool &); From 5b1cff79323680d210aca81dcff4f024ebd5a371 Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Thu, 19 Mar 2015 10:05:07 -0700 Subject: [PATCH 002/109] Replace uint32_t/uint64_t type usage with __uint32_t/__uint64_t. * libc/include/sys/time.h: Replace uint32_t and uint64_t with __uint32_t and __uint64_t. --- newlib/libc/include/sys/time.h | 36 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h index ce8cad662..e65910467 100644 --- a/newlib/libc/include/sys/time.h +++ b/newlib/libc/include/sys/time.h @@ -57,13 +57,13 @@ struct timezone { #if __BSD_VISIBLE struct bintime { time_t sec; - uint64_t frac; + __uint64_t frac; }; static __inline void -bintime_addx(struct bintime *_bt, uint64_t _x) +bintime_addx(struct bintime *_bt, __uint64_t _x) { - uint64_t _u; + __uint64_t _u; _u = _bt->frac; _bt->frac += _x; @@ -74,7 +74,7 @@ bintime_addx(struct bintime *_bt, uint64_t _x) static __inline void bintime_add(struct bintime *_bt, const struct bintime *_bt2) { - uint64_t _u; + __uint64_t _u; _u = _bt->frac; _bt->frac += _bt2->frac; @@ -86,7 +86,7 @@ bintime_add(struct bintime *_bt, const struct bintime *_bt2) static __inline void bintime_sub(struct bintime *_bt, const struct bintime *_bt2) { - uint64_t _u; + __uint64_t _u; _u = _bt->frac; _bt->frac -= _bt2->frac; @@ -98,7 +98,7 @@ bintime_sub(struct bintime *_bt, const struct bintime *_bt2) static __inline void bintime_mul(struct bintime *_bt, u_int _x) { - uint64_t _p1, _p2; + __uint64_t _p1, _p2; _p1 = (_bt->frac & 0xffffffffull) * _x; _p2 = (_bt->frac >> 32) * _x + (_p1 >> 32); @@ -117,7 +117,7 @@ bintime_shift(struct bintime *_bt, int _exp) _bt->frac <<= _exp; } else if (_exp < 0) { _bt->frac >>= -_exp; - _bt->frac |= (uint64_t)_bt->sec << (64 + _exp); + _bt->frac |= (__uint64_t)_bt->sec << (64 + _exp); _bt->sec >>= -_exp; } } @@ -179,8 +179,8 @@ bintime2timespec(const struct bintime *_bt, struct timespec *_ts) { _ts->tv_sec = _bt->sec; - _ts->tv_nsec = ((uint64_t)1000000000 * - (uint32_t)(_bt->frac >> 32)) >> 32; + _ts->tv_nsec = ((__uint64_t)1000000000 * + (__uint32_t)(_bt->frac >> 32)) >> 32; } static __inline void @@ -189,7 +189,7 @@ timespec2bintime(const struct timespec *_ts, struct bintime *_bt) _bt->sec = _ts->tv_sec; /* 18446744073 = int(2^64 / 1000000000) */ - _bt->frac = _ts->tv_nsec * (uint64_t)18446744073LL; + _bt->frac = _ts->tv_nsec * (__uint64_t)18446744073LL; } static __inline void @@ -197,7 +197,7 @@ bintime2timeval(const struct bintime *_bt, struct timeval *_tv) { _tv->tv_sec = _bt->sec; - _tv->tv_usec = ((uint64_t)1000000 * (uint32_t)(_bt->frac >> 32)) >> 32; + _tv->tv_usec = ((__uint64_t)1000000 * (__uint32_t)(_bt->frac >> 32)) >> 32; } static __inline void @@ -206,7 +206,7 @@ timeval2bintime(const struct timeval *_tv, struct bintime *_bt) _bt->sec = _tv->tv_sec; /* 18446744073709 = int(2^64 / 1000000) */ - _bt->frac = _tv->tv_usec * (uint64_t)18446744073709LL; + _bt->frac = _tv->tv_usec * (__uint64_t)18446744073709LL; } static __inline struct timespec @@ -215,7 +215,7 @@ sbttots(sbintime_t _sbt) struct timespec _ts; _ts.tv_sec = _sbt >> 32; - _ts.tv_nsec = ((uint64_t)1000000000 * (uint32_t)_sbt) >> 32; + _ts.tv_nsec = ((__uint64_t)1000000000 * (__uint32_t)_sbt) >> 32; return (_ts); } @@ -224,7 +224,7 @@ tstosbt(struct timespec _ts) { return (((sbintime_t)_ts.tv_sec << 32) + - (_ts.tv_nsec * (((uint64_t)1 << 63) / 500000000) >> 32)); + (_ts.tv_nsec * (((__uint64_t)1 << 63) / 500000000) >> 32)); } static __inline struct timeval @@ -233,7 +233,7 @@ sbttotv(sbintime_t _sbt) struct timeval _tv; _tv.tv_sec = _sbt >> 32; - _tv.tv_usec = ((uint64_t)1000000 * (uint32_t)_sbt) >> 32; + _tv.tv_usec = ((__uint64_t)1000000 * (__uint32_t)_sbt) >> 32; return (_tv); } @@ -242,7 +242,7 @@ tvtosbt(struct timeval _tv) { return (((sbintime_t)_tv.tv_sec << 32) + - (_tv.tv_usec * (((uint64_t)1 << 63) / 500000) >> 32)); + (_tv.tv_usec * (((__uint64_t)1 << 63) / 500000) >> 32)); } #endif /* __BSD_VISIBLE */ @@ -390,7 +390,7 @@ int tvtohz(struct timeval *tv); #define TC_DEFAULTPERC 5 #define BT2FREQ(bt) \ - (((uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) / \ + (((__uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) / \ ((bt)->frac >> 1)) #define SBT2FREQ(sbt) ((SBT_1S + ((sbt) >> 1)) / (sbt)) @@ -398,7 +398,7 @@ int tvtohz(struct timeval *tv); #define FREQ2BT(freq, bt) \ { \ (bt)->sec = 0; \ - (bt)->frac = ((uint64_t)0x8000000000000000 / (freq)) << 1; \ + (bt)->frac = ((__uint64_t)0x8000000000000000 / (freq)) << 1; \ } #define TIMESEL(sbt, sbt2) \ From ff39a89e02f1f5c279710367b8d72ef3e5d55959 Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Thu, 19 Mar 2015 10:19:35 -0700 Subject: [PATCH 003/109] Add ChangeLog entry for last patch to libc/include/sys/time.h. --- newlib/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 4a694a436..1b03bbc28 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2015-03-19 Steve Ellcey + + * libc/include/sys/time.h: Replace uint32_t and uint64_t + with __uint32_t and __uint64_t. + 2015-03-13 Jon TURNEY * libc/libc.texinfo: Fix directory entry. From 1c144ed142224cd112c1c9177a4231bef7975f9f Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 19 Mar 2015 18:27:03 +0100 Subject: [PATCH 004/109] Handle S_ISGID bit and multiple ACEs for owner * sec_acl.cc (get_posix_access): Handle multiple ACEs for the owner and primary group of the file. Handle the default primary group ACE as DEF_GROUP_OBJ entry if the directory has the S_ISGID bit set. Add comments. Minor code rearrangements. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/sec_acl.cc | 41 +++++++++++++++++++++++++++++++++++----- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5d45cdceb..260f469fe 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2015-03-19 Corinna Vinschen + + * sec_acl.cc (get_posix_access): Handle multiple ACEs for the + owner and primary group of the file. Handle the default primary + group ACE as DEF_GROUP_OBJ entry if the directory has the S_ISGID bit + set. Add comments. Minor code rearrangements. + 2015-03-18 Corinna Vinschen Preliminary read side implementation of new permission handling. diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index a93e191ff..aa1833920 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -456,10 +456,16 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, int pos, type, id; bool new_style = false; + bool saw_user_obj = false; + bool saw_group_obj = false; + bool saw_def_group_obj = false; + bool has_class_perm = false; + bool has_def_class_perm = false; + + mode_t class_perm = 0; + mode_t def_class_perm = 0; int types_def = 0; int def_pgrp_pos = -1; - bool has_class_perm = false, has_def_class_perm = false; - mode_t class_perm = 0, def_class_perm = 0; if (aclbufp && nentries < MIN_ACL_ENTRIES) { @@ -561,8 +567,7 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, new_style = true; type = (ace->Header.AceFlags & SUB_CONTAINERS_AND_OBJECTS_INHERIT) ? DEF_CLASS_OBJ : CLASS_OBJ; - if ((pos = searchace (lacl, MAX_ACL_ENTRIES, type, ILLEGAL_GID)) - >= 0) + if ((pos = searchace (lacl, MAX_ACL_ENTRIES, type)) >= 0) { lacl[pos].a_type = type; lacl[pos].a_id = ILLEGAL_GID; @@ -607,6 +612,7 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, type = DEF_GROUP_OBJ; types_def |= type; id = ILLEGAL_GID; + saw_def_group_obj = true; } else { @@ -616,6 +622,23 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, } if (!(ace->Header.AceFlags & INHERIT_ONLY || type & ACL_DEFAULT)) { + if (type == USER_OBJ) + { + /* If we get a second entry for the owner, it's an additional + USER entry. This can happen when chown'ing a file. */ + if (saw_user_obj) + type = USER; + if (ace->Header.AceType == ACCESS_ALLOWED_ACE_TYPE) + saw_user_obj = true; + } + else if (type == GROUP_OBJ) + { + /* Same for the primary group. */ + if (saw_group_obj) + type = GROUP; + if (ace->Header.AceType == ACCESS_ALLOWED_ACE_TYPE) + saw_group_obj = true; + } if ((pos = searchace (lacl, MAX_ACL_ENTRIES, type, id)) >= 0) { getace (lacl[pos], type, id, ace->Mask, ace->Header.AceType, @@ -636,7 +659,15 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, if (type == USER_OBJ) type = USER; else if (type == GROUP_OBJ) - type = GROUP; + { + /* If the SGID bit is set, the inheritable entry for the + primary group is, in fact, the DEF_GROUP_OBJ entry, + so don't change the type to GROUP in this case. */ + if (!new_style || saw_def_group_obj || !(attr & S_ISGID)) + type = GROUP; + else if (ace->Header.AceType == ACCESS_ALLOWED_ACE_TYPE) + saw_def_group_obj = true; + } type |= ACL_DEFAULT; types_def |= type; if ((pos = searchace (lacl, MAX_ACL_ENTRIES, type, id)) >= 0) From 548d795d62cbff2c0edfb53513226c1764ec04a7 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 23 Mar 2015 11:52:05 +0100 Subject: [PATCH 005/109] Drop cygwin/_types.h. * include/cygwin/_types.h: Drop unused file. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/include/cygwin/_types.h | 16 ---------------- 2 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 winsup/cygwin/include/cygwin/_types.h diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 260f469fe..49d5dfc7a 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2015-03-23 Corinna Vinschen + + * include/cygwin/_types.h: Drop unused file. + 2015-03-19 Corinna Vinschen * sec_acl.cc (get_posix_access): Handle multiple ACEs for the diff --git a/winsup/cygwin/include/cygwin/_types.h b/winsup/cygwin/include/cygwin/_types.h deleted file mode 100644 index b96267622..000000000 --- a/winsup/cygwin/include/cygwin/_types.h +++ /dev/null @@ -1,16 +0,0 @@ -/* cygwin/_types.h - - Copyright 2004 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -#ifndef _CYGWIN__TYPES_H -#define _CYGWIN__TYPES_H - -typedef void *_flock_t; - -#endif /* _CYGWIN__TYPES_H */ From 5799260aedacf7da5e9e8f3dc960a9edc0e180ce Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 18 Mar 2015 15:44:41 -0500 Subject: [PATCH 006/109] Change from configure time to compile time probe for intptr_t definition. 2015-03-23 Joel Sherrill . * configure: Regenerated. --- newlib/ChangeLog | 9 +++++ newlib/configure | 69 -------------------------------- newlib/configure.in | 41 ------------------- newlib/libc/include/inttypes.h | 1 + newlib/libc/include/sys/config.h | 26 ++++++++++++ 5 files changed, 36 insertions(+), 110 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 1b03bbc28..0f2528d47 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,12 @@ +2015-03-23 Joel Sherrill . + * configure: Regenerated. + 2015-03-19 Steve Ellcey * libc/include/sys/time.h: Replace uint32_t and uint64_t diff --git a/newlib/configure b/newlib/configure index 8000b87e1..19cf1d9a0 100755 --- a/newlib/configure +++ b/newlib/configure @@ -12646,75 +12646,6 @@ _ACEOF fi -#### Determine if uintptr_t is unsigned long long -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether uintptr_t equals unsigned long long" >&5 -$as_echo_n "checking whether uintptr_t equals unsigned long long... " >&6; } -if ${newlib_cv_uintptr_eq_ulonglong+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.c < -extern int foo(uintptr_t); -extern int foo(unsigned long long); -EOF -if { ac_try='${CC} $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c - 1>&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } -then - newlib_cv_uintptr_eq_ulonglong=yes; -else - newlib_cv_uintptr_eq_ulonglong=no; -fi -rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $newlib_cv_uintptr_eq_ulonglong" >&5 -$as_echo "$newlib_cv_uintptr_eq_ulonglong" >&6; } -if test $newlib_cv_uintptr_eq_ulonglong = yes; then - cat >>confdefs.h <<_ACEOF -#define _UINTPTR_EQ_ULONGLONG 1 -_ACEOF - -else -#### Determine if uintptr_t is unsigned long -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether uintptr_t equals unsigned long" >&5 -$as_echo_n "checking whether uintptr_t equals unsigned long... " >&6; } -if ${newlib_cv_uintptr_eq_ulong+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.c < -extern int foo(uintptr_t); -extern int foo(unsigned long); -EOF -if { ac_try='${CC} $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c - 1>&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } -then - newlib_cv_uintptr_eq_ulong=yes; -else - newlib_cv_uintptr_eq_ulong=no; -fi -rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $newlib_cv_uintptr_eq_ulong" >&5 -$as_echo "$newlib_cv_uintptr_eq_ulong" >&6; } -if test $newlib_cv_uintptr_eq_ulong = yes; then - cat >>confdefs.h <<_ACEOF -#define _UINTPTR_EQ_ULONG 1 -_ACEOF - -fi -fi - - ac_config_files="$ac_config_files Makefile" diff --git a/newlib/configure.in b/newlib/configure.in index fbe5b7b63..9465787ed 100644 --- a/newlib/configure.in +++ b/newlib/configure.in @@ -617,47 +617,6 @@ if test $newlib_cv_ldbl_eq_dbl = yes; then AC_DEFINE_UNQUOTED(_LDBL_EQ_DBL) fi -#### Determine if uintptr_t is unsigned long long -AC_CACHE_CHECK(whether uintptr_t equals unsigned long long, - newlib_cv_uintptr_eq_ulonglong, [dnl -cat > conftest.c < -extern int foo(uintptr_t); -extern int foo(unsigned long long); -EOF -if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c - 1>&AS_MESSAGE_LOG_FD]) -then - newlib_cv_uintptr_eq_ulonglong=yes; -else - newlib_cv_uintptr_eq_ulonglong=no; -fi -rm -f conftest*]) -if test $newlib_cv_uintptr_eq_ulonglong = yes; then - AC_DEFINE_UNQUOTED(_UINTPTR_EQ_ULONGLONG) -else -#### Determine if uintptr_t is unsigned long -AC_CACHE_CHECK(whether uintptr_t equals unsigned long, - newlib_cv_uintptr_eq_ulong, [dnl -cat > conftest.c < -extern int foo(uintptr_t); -extern int foo(unsigned long); -EOF -if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c - 1>&AS_MESSAGE_LOG_FD]) -then - newlib_cv_uintptr_eq_ulong=yes; -else - newlib_cv_uintptr_eq_ulong=no; -fi -rm -f conftest*]) -if test $newlib_cv_uintptr_eq_ulong = yes; then - AC_DEFINE_UNQUOTED(_UINTPTR_EQ_ULONG) -fi -fi - - AC_SUBST(CFLAGS) AC_CONFIG_FILES([Makefile], diff --git a/newlib/libc/include/inttypes.h b/newlib/libc/include/inttypes.h index 39bf13511..52b2d845c 100644 --- a/newlib/libc/include/inttypes.h +++ b/newlib/libc/include/inttypes.h @@ -14,6 +14,7 @@ #define _INTTYPES_H #include +#include #include #include #define __need_wchar_t diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h index 5297befe5..04f1e3abf 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -287,4 +287,30 @@ #define _MB_EXTENDED_CHARSETS_WINDOWS 1 #endif +/* Determine how uintptr_t is defined by gcc for this target. This + is used to determine the correct printf() constant in inttypes.h */ +#pragma push_macro("signed") +#pragma push_macro("int") +#pragma push_macro("long") +#undef signed +#undef int +#undef long +#define signed +0 +#define int +0 +#define long +1 +#if __INTPTR_TYPE__ == 2 +#define _UINTPTR_EQ_ULONGLONG +#elif __INTPTR_TYPE__ == 1 +#define _UINTPTR_EQ_ULONG +#elif __INTPTR_TYPE__ == 0 +/* Nothing to define because intptr_t is safe to print as an int. */ +#else +#error "Unable to determine type definition of uintptr_t" +#endif +#undef long +#undef int +#undef signed +#pragma pop_macro("signed") +#pragma pop_macro("int") +#pragma pop_macro("long") #endif /* __SYS_CONFIG_H__ */ From ef23a12ff8f840cc571e47870cd5f4ad6bca4553 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 23 Mar 2015 09:41:22 -0500 Subject: [PATCH 007/109] * newlib.hin: Remove _UINTPTR_EQ_ULONG and _UINTPTR_EQ_ULONGLONG. 2013-03-23 Joel Sherrill * newlib.hin: Remove _UINTPTR_EQ_ULONG and _UINTPTR_EQ_ULONGLONG. --- newlib/ChangeLog | 4 ++++ newlib/newlib.hin | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 0f2528d47..356860584 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2013-03-23 Joel Sherrill + + * newlib.hin: Remove _UINTPTR_EQ_ULONG and _UINTPTR_EQ_ULONGLONG. + 2015-03-23 Joel Sherrill Date: Tue, 24 Mar 2015 10:42:45 +0100 Subject: [PATCH 008/109] Ignore __STDC_{FORMAT,LIMIT,CONSTANT}_MACROS Per glibc BZ #15366: * inttypes.h: Drop __STDC_FORMAT_MACROS consideration. * stdint.h: Drop __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS consideration. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/include/inttypes.h | 9 +-------- winsup/cygwin/include/stdint.h | 16 +--------------- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 49d5dfc7a..a7fc6f9c4 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2015-03-24 Corinna Vinschen + + Per glibc BZ #15366: + * inttypes.h: Drop __STDC_FORMAT_MACROS consideration. + * stdint.h: Drop __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS + consideration. + 2015-03-23 Corinna Vinschen * include/cygwin/_types.h: Drop unused file. diff --git a/winsup/cygwin/include/inttypes.h b/winsup/cygwin/include/inttypes.h index eb60e79e4..5a646813b 100644 --- a/winsup/cygwin/include/inttypes.h +++ b/winsup/cygwin/include/inttypes.h @@ -1,6 +1,6 @@ /* inttypes.h - fixed size integer types - Copyright 2003, 2005, 2009, 2010, 2012 Red Hat, Inc. + Copyright 2003, 2005, 2009, 2010, 2012, 2015 Red Hat, Inc. This file is part of Cygwin. @@ -16,11 +16,6 @@ details. */ #include #include -/* C99 requires that in C++ the following macros should be defined only - if requested. */ -#if !defined (__cplusplus) || defined (__STDC_FORMAT_MACROS) \ - || defined (__INSIDE_CYGWIN__) - #if __WORDSIZE == 64 #define __PRI64 "l" #define __PRIFAST "l" @@ -247,8 +242,6 @@ details. */ #define SCNxMAX __SCN64 "x" #define SCNxPTR __SCNPTR "x" -#endif /* !__cplusplus || __STDC_FORMAT_MACROS || __INSIDE_CYGWIN__ */ - #ifdef __cplusplus extern "C" { #endif diff --git a/winsup/cygwin/include/stdint.h b/winsup/cygwin/include/stdint.h index 94b6b7673..7da9caf6f 100644 --- a/winsup/cygwin/include/stdint.h +++ b/winsup/cygwin/include/stdint.h @@ -1,6 +1,6 @@ /* stdint.h - integer types - Copyright 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Red Hat, Inc. + Copyright 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2012 2015 Red Hat, Inc. This file is part of Cygwin. @@ -109,11 +109,6 @@ typedef long long intmax_t; typedef unsigned long long uintmax_t; #endif -/* C99 requires that in C++ the following macros should be defined only - if requested. */ -#if !defined (__cplusplus) || defined (__STDC_LIMIT_MACROS) \ - || defined (__INSIDE_CYGWIN__) - #ifdef __x86_64__ # define __I64(n) n ## L # define __U64(n) n ## UL @@ -248,13 +243,6 @@ typedef unsigned long long uintmax_t; #define WINT_MAX (4294967295U) #endif -#endif /* !__cplusplus || __STDC_LIMIT_MACROS || __INSIDE_CYGWIN__ */ - -/* C99 requires that in C++ the following macros should be defined only - if requested. */ -#if !defined (__cplusplus) || defined (__STDC_CONSTANT_MACROS) \ - || defined (__INSIDE_CYGWIN__) - /* Macros for minimum-width integer constant expressions */ #define INT8_C(x) x @@ -285,6 +273,4 @@ typedef unsigned long long uintmax_t; #define UINTMAX_C(x) x ## ULL #endif -#endif /* !__cplusplus || __STDC_CONSTANT_MACROS || __INSIDE_CYGWIN__ */ - #endif /* _STDINT_H */ From d70f57112fbe1d9ab1a7edfb251e6dd78a78b0e0 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 23 Mar 2015 21:08:08 +0100 Subject: [PATCH 009/109] Import from FreeBSD * libc/include/sys/tree.h: New file. --- newlib/ChangeLog | 4 + newlib/libc/include/sys/tree.h | 801 +++++++++++++++++++++++++++++++++ 2 files changed, 805 insertions(+) create mode 100644 newlib/libc/include/sys/tree.h diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 356860584..8ded7abde 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2015-03-23 Sebastian Huber + + * libc/include/sys/tree.h: New file. + 2013-03-23 Joel Sherrill * newlib.hin: Remove _UINTPTR_EQ_ULONG and _UINTPTR_EQ_ULONGLONG. diff --git a/newlib/libc/include/sys/tree.h b/newlib/libc/include/sys/tree.h new file mode 100644 index 000000000..f4167c4e4 --- /dev/null +++ b/newlib/libc/include/sys/tree.h @@ -0,0 +1,801 @@ +/* $NetBSD: tree.h,v 1.8 2004/03/28 19:38:30 provos Exp $ */ +/* $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $ */ +/* $FreeBSD$ */ + +/*- + * Copyright 2002 Niels Provos + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SYS_TREE_H_ +#define _SYS_TREE_H_ + +#include + +/* + * This file defines data structures for different types of trees: + * splay trees and red-black trees. + * + * A splay tree is a self-organizing data structure. Every operation + * on the tree causes a splay to happen. The splay moves the requested + * node to the root of the tree and partly rebalances it. + * + * This has the benefit that request locality causes faster lookups as + * the requested nodes move to the top of the tree. On the other hand, + * every lookup causes memory writes. + * + * The Balance Theorem bounds the total access time for m operations + * and n inserts on an initially empty tree as O((m + n)lg n). The + * amortized cost for a sequence of m accesses to a splay tree is O(lg n); + * + * A red-black tree is a binary search tree with the node color as an + * extra attribute. It fulfills a set of conditions: + * - every search path from the root to a leaf consists of the + * same number of black nodes, + * - each red node (except for the root) has a black parent, + * - each leaf node is black. + * + * Every operation on a red-black tree is bounded as O(lg n). + * The maximum height of a red-black tree is 2lg (n+1). + */ + +#define SPLAY_HEAD(name, type) \ +struct name { \ + struct type *sph_root; /* root of the tree */ \ +} + +#define SPLAY_INITIALIZER(root) \ + { NULL } + +#define SPLAY_INIT(root) do { \ + (root)->sph_root = NULL; \ +} while (/*CONSTCOND*/ 0) + +#define SPLAY_ENTRY(type) \ +struct { \ + struct type *spe_left; /* left element */ \ + struct type *spe_right; /* right element */ \ +} + +#define SPLAY_LEFT(elm, field) (elm)->field.spe_left +#define SPLAY_RIGHT(elm, field) (elm)->field.spe_right +#define SPLAY_ROOT(head) (head)->sph_root +#define SPLAY_EMPTY(head) (SPLAY_ROOT(head) == NULL) + +/* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */ +#define SPLAY_ROTATE_RIGHT(head, tmp, field) do { \ + SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \ + SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ + (head)->sph_root = tmp; \ +} while (/*CONSTCOND*/ 0) + +#define SPLAY_ROTATE_LEFT(head, tmp, field) do { \ + SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \ + SPLAY_LEFT(tmp, field) = (head)->sph_root; \ + (head)->sph_root = tmp; \ +} while (/*CONSTCOND*/ 0) + +#define SPLAY_LINKLEFT(head, tmp, field) do { \ + SPLAY_LEFT(tmp, field) = (head)->sph_root; \ + tmp = (head)->sph_root; \ + (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \ +} while (/*CONSTCOND*/ 0) + +#define SPLAY_LINKRIGHT(head, tmp, field) do { \ + SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ + tmp = (head)->sph_root; \ + (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \ +} while (/*CONSTCOND*/ 0) + +#define SPLAY_ASSEMBLE(head, node, left, right, field) do { \ + SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \ + SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\ + SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \ + SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \ +} while (/*CONSTCOND*/ 0) + +/* Generates prototypes and inline functions */ + +#define SPLAY_PROTOTYPE(name, type, field, cmp) \ +void name##_SPLAY(struct name *, struct type *); \ +void name##_SPLAY_MINMAX(struct name *, int); \ +struct type *name##_SPLAY_INSERT(struct name *, struct type *); \ +struct type *name##_SPLAY_REMOVE(struct name *, struct type *); \ + \ +/* Finds the node with the same key as elm */ \ +static __inline struct type * \ +name##_SPLAY_FIND(struct name *head, struct type *elm) \ +{ \ + if (SPLAY_EMPTY(head)) \ + return(NULL); \ + name##_SPLAY(head, elm); \ + if ((cmp)(elm, (head)->sph_root) == 0) \ + return (head->sph_root); \ + return (NULL); \ +} \ + \ +static __inline struct type * \ +name##_SPLAY_NEXT(struct name *head, struct type *elm) \ +{ \ + name##_SPLAY(head, elm); \ + if (SPLAY_RIGHT(elm, field) != NULL) { \ + elm = SPLAY_RIGHT(elm, field); \ + while (SPLAY_LEFT(elm, field) != NULL) { \ + elm = SPLAY_LEFT(elm, field); \ + } \ + } else \ + elm = NULL; \ + return (elm); \ +} \ + \ +static __inline struct type * \ +name##_SPLAY_MIN_MAX(struct name *head, int val) \ +{ \ + name##_SPLAY_MINMAX(head, val); \ + return (SPLAY_ROOT(head)); \ +} + +/* Main splay operation. + * Moves node close to the key of elm to top + */ +#define SPLAY_GENERATE(name, type, field, cmp) \ +struct type * \ +name##_SPLAY_INSERT(struct name *head, struct type *elm) \ +{ \ + if (SPLAY_EMPTY(head)) { \ + SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL; \ + } else { \ + int __comp; \ + name##_SPLAY(head, elm); \ + __comp = (cmp)(elm, (head)->sph_root); \ + if(__comp < 0) { \ + SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);\ + SPLAY_RIGHT(elm, field) = (head)->sph_root; \ + SPLAY_LEFT((head)->sph_root, field) = NULL; \ + } else if (__comp > 0) { \ + SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);\ + SPLAY_LEFT(elm, field) = (head)->sph_root; \ + SPLAY_RIGHT((head)->sph_root, field) = NULL; \ + } else \ + return ((head)->sph_root); \ + } \ + (head)->sph_root = (elm); \ + return (NULL); \ +} \ + \ +struct type * \ +name##_SPLAY_REMOVE(struct name *head, struct type *elm) \ +{ \ + struct type *__tmp; \ + if (SPLAY_EMPTY(head)) \ + return (NULL); \ + name##_SPLAY(head, elm); \ + if ((cmp)(elm, (head)->sph_root) == 0) { \ + if (SPLAY_LEFT((head)->sph_root, field) == NULL) { \ + (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);\ + } else { \ + __tmp = SPLAY_RIGHT((head)->sph_root, field); \ + (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);\ + name##_SPLAY(head, elm); \ + SPLAY_RIGHT((head)->sph_root, field) = __tmp; \ + } \ + return (elm); \ + } \ + return (NULL); \ +} \ + \ +void \ +name##_SPLAY(struct name *head, struct type *elm) \ +{ \ + struct type __node, *__left, *__right, *__tmp; \ + int __comp; \ +\ + SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\ + __left = __right = &__node; \ +\ + while ((__comp = (cmp)(elm, (head)->sph_root)) != 0) { \ + if (__comp < 0) { \ + __tmp = SPLAY_LEFT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if ((cmp)(elm, __tmp) < 0){ \ + SPLAY_ROTATE_RIGHT(head, __tmp, field); \ + if (SPLAY_LEFT((head)->sph_root, field) == NULL)\ + break; \ + } \ + SPLAY_LINKLEFT(head, __right, field); \ + } else if (__comp > 0) { \ + __tmp = SPLAY_RIGHT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if ((cmp)(elm, __tmp) > 0){ \ + SPLAY_ROTATE_LEFT(head, __tmp, field); \ + if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\ + break; \ + } \ + SPLAY_LINKRIGHT(head, __left, field); \ + } \ + } \ + SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \ +} \ + \ +/* Splay with either the minimum or the maximum element \ + * Used to find minimum or maximum element in tree. \ + */ \ +void name##_SPLAY_MINMAX(struct name *head, int __comp) \ +{ \ + struct type __node, *__left, *__right, *__tmp; \ +\ + SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\ + __left = __right = &__node; \ +\ + while (1) { \ + if (__comp < 0) { \ + __tmp = SPLAY_LEFT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if (__comp < 0){ \ + SPLAY_ROTATE_RIGHT(head, __tmp, field); \ + if (SPLAY_LEFT((head)->sph_root, field) == NULL)\ + break; \ + } \ + SPLAY_LINKLEFT(head, __right, field); \ + } else if (__comp > 0) { \ + __tmp = SPLAY_RIGHT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if (__comp > 0) { \ + SPLAY_ROTATE_LEFT(head, __tmp, field); \ + if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\ + break; \ + } \ + SPLAY_LINKRIGHT(head, __left, field); \ + } \ + } \ + SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \ +} + +#define SPLAY_NEGINF -1 +#define SPLAY_INF 1 + +#define SPLAY_INSERT(name, x, y) name##_SPLAY_INSERT(x, y) +#define SPLAY_REMOVE(name, x, y) name##_SPLAY_REMOVE(x, y) +#define SPLAY_FIND(name, x, y) name##_SPLAY_FIND(x, y) +#define SPLAY_NEXT(name, x, y) name##_SPLAY_NEXT(x, y) +#define SPLAY_MIN(name, x) (SPLAY_EMPTY(x) ? NULL \ + : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF)) +#define SPLAY_MAX(name, x) (SPLAY_EMPTY(x) ? NULL \ + : name##_SPLAY_MIN_MAX(x, SPLAY_INF)) + +#define SPLAY_FOREACH(x, name, head) \ + for ((x) = SPLAY_MIN(name, head); \ + (x) != NULL; \ + (x) = SPLAY_NEXT(name, head, x)) + +/* Macros that define a red-black tree */ +#define RB_HEAD(name, type) \ +struct name { \ + struct type *rbh_root; /* root of the tree */ \ +} + +#define RB_INITIALIZER(root) \ + { NULL } + +#define RB_INIT(root) do { \ + (root)->rbh_root = NULL; \ +} while (/*CONSTCOND*/ 0) + +#define RB_BLACK 0 +#define RB_RED 1 +#define RB_ENTRY(type) \ +struct { \ + struct type *rbe_left; /* left element */ \ + struct type *rbe_right; /* right element */ \ + struct type *rbe_parent; /* parent element */ \ + int rbe_color; /* node color */ \ +} + +#define RB_LEFT(elm, field) (elm)->field.rbe_left +#define RB_RIGHT(elm, field) (elm)->field.rbe_right +#define RB_PARENT(elm, field) (elm)->field.rbe_parent +#define RB_COLOR(elm, field) (elm)->field.rbe_color +#define RB_ROOT(head) (head)->rbh_root +#define RB_EMPTY(head) (RB_ROOT(head) == NULL) + +#define RB_SET(elm, parent, field) do { \ + RB_PARENT(elm, field) = parent; \ + RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \ + RB_COLOR(elm, field) = RB_RED; \ +} while (/*CONSTCOND*/ 0) + +#define RB_SET_BLACKRED(black, red, field) do { \ + RB_COLOR(black, field) = RB_BLACK; \ + RB_COLOR(red, field) = RB_RED; \ +} while (/*CONSTCOND*/ 0) + +#ifndef RB_AUGMENT +#define RB_AUGMENT(x) do {} while (0) +#endif + +#define RB_ROTATE_LEFT(head, elm, tmp, field) do { \ + (tmp) = RB_RIGHT(elm, field); \ + if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) { \ + RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \ + } \ + RB_AUGMENT(elm); \ + if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \ + if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ + RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ + else \ + RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ + } else \ + (head)->rbh_root = (tmp); \ + RB_LEFT(tmp, field) = (elm); \ + RB_PARENT(elm, field) = (tmp); \ + RB_AUGMENT(tmp); \ + if ((RB_PARENT(tmp, field))) \ + RB_AUGMENT(RB_PARENT(tmp, field)); \ +} while (/*CONSTCOND*/ 0) + +#define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \ + (tmp) = RB_LEFT(elm, field); \ + if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) { \ + RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \ + } \ + RB_AUGMENT(elm); \ + if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \ + if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ + RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ + else \ + RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ + } else \ + (head)->rbh_root = (tmp); \ + RB_RIGHT(tmp, field) = (elm); \ + RB_PARENT(elm, field) = (tmp); \ + RB_AUGMENT(tmp); \ + if ((RB_PARENT(tmp, field))) \ + RB_AUGMENT(RB_PARENT(tmp, field)); \ +} while (/*CONSTCOND*/ 0) + +/* Generates prototypes and inline functions */ +#define RB_PROTOTYPE(name, type, field, cmp) \ + RB_PROTOTYPE_INTERNAL(name, type, field, cmp,) +#define RB_PROTOTYPE_STATIC(name, type, field, cmp) \ + RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __unused static) +#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \ + RB_PROTOTYPE_INSERT_COLOR(name, type, attr); \ + RB_PROTOTYPE_REMOVE_COLOR(name, type, attr); \ + RB_PROTOTYPE_INSERT(name, type, attr); \ + RB_PROTOTYPE_REMOVE(name, type, attr); \ + RB_PROTOTYPE_FIND(name, type, attr); \ + RB_PROTOTYPE_NFIND(name, type, attr); \ + RB_PROTOTYPE_NEXT(name, type, attr); \ + RB_PROTOTYPE_PREV(name, type, attr); \ + RB_PROTOTYPE_MINMAX(name, type, attr); +#define RB_PROTOTYPE_INSERT_COLOR(name, type, attr) \ + attr void name##_RB_INSERT_COLOR(struct name *, struct type *) +#define RB_PROTOTYPE_REMOVE_COLOR(name, type, attr) \ + attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *) +#define RB_PROTOTYPE_REMOVE(name, type, attr) \ + attr struct type *name##_RB_REMOVE(struct name *, struct type *) +#define RB_PROTOTYPE_INSERT(name, type, attr) \ + attr struct type *name##_RB_INSERT(struct name *, struct type *) +#define RB_PROTOTYPE_FIND(name, type, attr) \ + attr struct type *name##_RB_FIND(struct name *, struct type *) +#define RB_PROTOTYPE_NFIND(name, type, attr) \ + attr struct type *name##_RB_NFIND(struct name *, struct type *) +#define RB_PROTOTYPE_NEXT(name, type, attr) \ + attr struct type *name##_RB_NEXT(struct type *) +#define RB_PROTOTYPE_PREV(name, type, attr) \ + attr struct type *name##_RB_PREV(struct type *) +#define RB_PROTOTYPE_MINMAX(name, type, attr) \ + attr struct type *name##_RB_MINMAX(struct name *, int) + +/* Main rb operation. + * Moves node close to the key of elm to top + */ +#define RB_GENERATE(name, type, field, cmp) \ + RB_GENERATE_INTERNAL(name, type, field, cmp,) +#define RB_GENERATE_STATIC(name, type, field, cmp) \ + RB_GENERATE_INTERNAL(name, type, field, cmp, __unused static) +#define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \ + RB_GENERATE_INSERT_COLOR(name, type, field, attr) \ + RB_GENERATE_REMOVE_COLOR(name, type, field, attr) \ + RB_GENERATE_INSERT(name, type, field, cmp, attr) \ + RB_GENERATE_REMOVE(name, type, field, attr) \ + RB_GENERATE_FIND(name, type, field, cmp, attr) \ + RB_GENERATE_NFIND(name, type, field, cmp, attr) \ + RB_GENERATE_NEXT(name, type, field, attr) \ + RB_GENERATE_PREV(name, type, field, attr) \ + RB_GENERATE_MINMAX(name, type, field, attr) + +#define RB_GENERATE_INSERT_COLOR(name, type, field, attr) \ +attr void \ +name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \ +{ \ + struct type *parent, *gparent, *tmp; \ + while ((parent = RB_PARENT(elm, field)) != NULL && \ + RB_COLOR(parent, field) == RB_RED) { \ + gparent = RB_PARENT(parent, field); \ + if (parent == RB_LEFT(gparent, field)) { \ + tmp = RB_RIGHT(gparent, field); \ + if (tmp && RB_COLOR(tmp, field) == RB_RED) { \ + RB_COLOR(tmp, field) = RB_BLACK; \ + RB_SET_BLACKRED(parent, gparent, field);\ + elm = gparent; \ + continue; \ + } \ + if (RB_RIGHT(parent, field) == elm) { \ + RB_ROTATE_LEFT(head, parent, tmp, field);\ + tmp = parent; \ + parent = elm; \ + elm = tmp; \ + } \ + RB_SET_BLACKRED(parent, gparent, field); \ + RB_ROTATE_RIGHT(head, gparent, tmp, field); \ + } else { \ + tmp = RB_LEFT(gparent, field); \ + if (tmp && RB_COLOR(tmp, field) == RB_RED) { \ + RB_COLOR(tmp, field) = RB_BLACK; \ + RB_SET_BLACKRED(parent, gparent, field);\ + elm = gparent; \ + continue; \ + } \ + if (RB_LEFT(parent, field) == elm) { \ + RB_ROTATE_RIGHT(head, parent, tmp, field);\ + tmp = parent; \ + parent = elm; \ + elm = tmp; \ + } \ + RB_SET_BLACKRED(parent, gparent, field); \ + RB_ROTATE_LEFT(head, gparent, tmp, field); \ + } \ + } \ + RB_COLOR(head->rbh_root, field) = RB_BLACK; \ +} + +#define RB_GENERATE_REMOVE_COLOR(name, type, field, attr) \ +attr void \ +name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \ +{ \ + struct type *tmp; \ + while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) && \ + elm != RB_ROOT(head)) { \ + if (RB_LEFT(parent, field) == elm) { \ + tmp = RB_RIGHT(parent, field); \ + if (RB_COLOR(tmp, field) == RB_RED) { \ + RB_SET_BLACKRED(tmp, parent, field); \ + RB_ROTATE_LEFT(head, parent, tmp, field);\ + tmp = RB_RIGHT(parent, field); \ + } \ + if ((RB_LEFT(tmp, field) == NULL || \ + RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\ + (RB_RIGHT(tmp, field) == NULL || \ + RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\ + RB_COLOR(tmp, field) = RB_RED; \ + elm = parent; \ + parent = RB_PARENT(elm, field); \ + } else { \ + if (RB_RIGHT(tmp, field) == NULL || \ + RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\ + struct type *oleft; \ + if ((oleft = RB_LEFT(tmp, field)) \ + != NULL) \ + RB_COLOR(oleft, field) = RB_BLACK;\ + RB_COLOR(tmp, field) = RB_RED; \ + RB_ROTATE_RIGHT(head, tmp, oleft, field);\ + tmp = RB_RIGHT(parent, field); \ + } \ + RB_COLOR(tmp, field) = RB_COLOR(parent, field);\ + RB_COLOR(parent, field) = RB_BLACK; \ + if (RB_RIGHT(tmp, field)) \ + RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;\ + RB_ROTATE_LEFT(head, parent, tmp, field);\ + elm = RB_ROOT(head); \ + break; \ + } \ + } else { \ + tmp = RB_LEFT(parent, field); \ + if (RB_COLOR(tmp, field) == RB_RED) { \ + RB_SET_BLACKRED(tmp, parent, field); \ + RB_ROTATE_RIGHT(head, parent, tmp, field);\ + tmp = RB_LEFT(parent, field); \ + } \ + if ((RB_LEFT(tmp, field) == NULL || \ + RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\ + (RB_RIGHT(tmp, field) == NULL || \ + RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\ + RB_COLOR(tmp, field) = RB_RED; \ + elm = parent; \ + parent = RB_PARENT(elm, field); \ + } else { \ + if (RB_LEFT(tmp, field) == NULL || \ + RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\ + struct type *oright; \ + if ((oright = RB_RIGHT(tmp, field)) \ + != NULL) \ + RB_COLOR(oright, field) = RB_BLACK;\ + RB_COLOR(tmp, field) = RB_RED; \ + RB_ROTATE_LEFT(head, tmp, oright, field);\ + tmp = RB_LEFT(parent, field); \ + } \ + RB_COLOR(tmp, field) = RB_COLOR(parent, field);\ + RB_COLOR(parent, field) = RB_BLACK; \ + if (RB_LEFT(tmp, field)) \ + RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;\ + RB_ROTATE_RIGHT(head, parent, tmp, field);\ + elm = RB_ROOT(head); \ + break; \ + } \ + } \ + } \ + if (elm) \ + RB_COLOR(elm, field) = RB_BLACK; \ +} + +#define RB_GENERATE_REMOVE(name, type, field, attr) \ +attr struct type * \ +name##_RB_REMOVE(struct name *head, struct type *elm) \ +{ \ + struct type *child, *parent, *old = elm; \ + int color; \ + if (RB_LEFT(elm, field) == NULL) \ + child = RB_RIGHT(elm, field); \ + else if (RB_RIGHT(elm, field) == NULL) \ + child = RB_LEFT(elm, field); \ + else { \ + struct type *left; \ + elm = RB_RIGHT(elm, field); \ + while ((left = RB_LEFT(elm, field)) != NULL) \ + elm = left; \ + child = RB_RIGHT(elm, field); \ + parent = RB_PARENT(elm, field); \ + color = RB_COLOR(elm, field); \ + if (child) \ + RB_PARENT(child, field) = parent; \ + if (parent) { \ + if (RB_LEFT(parent, field) == elm) \ + RB_LEFT(parent, field) = child; \ + else \ + RB_RIGHT(parent, field) = child; \ + RB_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = child; \ + if (RB_PARENT(elm, field) == old) \ + parent = elm; \ + (elm)->field = (old)->field; \ + if (RB_PARENT(old, field)) { \ + if (RB_LEFT(RB_PARENT(old, field), field) == old)\ + RB_LEFT(RB_PARENT(old, field), field) = elm;\ + else \ + RB_RIGHT(RB_PARENT(old, field), field) = elm;\ + RB_AUGMENT(RB_PARENT(old, field)); \ + } else \ + RB_ROOT(head) = elm; \ + RB_PARENT(RB_LEFT(old, field), field) = elm; \ + if (RB_RIGHT(old, field)) \ + RB_PARENT(RB_RIGHT(old, field), field) = elm; \ + if (parent) { \ + left = parent; \ + do { \ + RB_AUGMENT(left); \ + } while ((left = RB_PARENT(left, field)) != NULL); \ + } \ + goto color; \ + } \ + parent = RB_PARENT(elm, field); \ + color = RB_COLOR(elm, field); \ + if (child) \ + RB_PARENT(child, field) = parent; \ + if (parent) { \ + if (RB_LEFT(parent, field) == elm) \ + RB_LEFT(parent, field) = child; \ + else \ + RB_RIGHT(parent, field) = child; \ + RB_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = child; \ +color: \ + if (color == RB_BLACK) \ + name##_RB_REMOVE_COLOR(head, parent, child); \ + return (old); \ +} \ + +#define RB_GENERATE_INSERT(name, type, field, cmp, attr) \ +/* Inserts a node into the RB tree */ \ +attr struct type * \ +name##_RB_INSERT(struct name *head, struct type *elm) \ +{ \ + struct type *tmp; \ + struct type *parent = NULL; \ + int comp = 0; \ + tmp = RB_ROOT(head); \ + while (tmp) { \ + parent = tmp; \ + comp = (cmp)(elm, parent); \ + if (comp < 0) \ + tmp = RB_LEFT(tmp, field); \ + else if (comp > 0) \ + tmp = RB_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + RB_SET(elm, parent, field); \ + if (parent != NULL) { \ + if (comp < 0) \ + RB_LEFT(parent, field) = elm; \ + else \ + RB_RIGHT(parent, field) = elm; \ + RB_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = elm; \ + name##_RB_INSERT_COLOR(head, elm); \ + return (NULL); \ +} + +#define RB_GENERATE_FIND(name, type, field, cmp, attr) \ +/* Finds the node with the same key as elm */ \ +attr struct type * \ +name##_RB_FIND(struct name *head, struct type *elm) \ +{ \ + struct type *tmp = RB_ROOT(head); \ + int comp; \ + while (tmp) { \ + comp = cmp(elm, tmp); \ + if (comp < 0) \ + tmp = RB_LEFT(tmp, field); \ + else if (comp > 0) \ + tmp = RB_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + return (NULL); \ +} + +#define RB_GENERATE_NFIND(name, type, field, cmp, attr) \ +/* Finds the first node greater than or equal to the search key */ \ +attr struct type * \ +name##_RB_NFIND(struct name *head, struct type *elm) \ +{ \ + struct type *tmp = RB_ROOT(head); \ + struct type *res = NULL; \ + int comp; \ + while (tmp) { \ + comp = cmp(elm, tmp); \ + if (comp < 0) { \ + res = tmp; \ + tmp = RB_LEFT(tmp, field); \ + } \ + else if (comp > 0) \ + tmp = RB_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + return (res); \ +} + +#define RB_GENERATE_NEXT(name, type, field, attr) \ +/* ARGSUSED */ \ +attr struct type * \ +name##_RB_NEXT(struct type *elm) \ +{ \ + if (RB_RIGHT(elm, field)) { \ + elm = RB_RIGHT(elm, field); \ + while (RB_LEFT(elm, field)) \ + elm = RB_LEFT(elm, field); \ + } else { \ + if (RB_PARENT(elm, field) && \ + (elm == RB_LEFT(RB_PARENT(elm, field), field))) \ + elm = RB_PARENT(elm, field); \ + else { \ + while (RB_PARENT(elm, field) && \ + (elm == RB_RIGHT(RB_PARENT(elm, field), field)))\ + elm = RB_PARENT(elm, field); \ + elm = RB_PARENT(elm, field); \ + } \ + } \ + return (elm); \ +} + +#define RB_GENERATE_PREV(name, type, field, attr) \ +/* ARGSUSED */ \ +attr struct type * \ +name##_RB_PREV(struct type *elm) \ +{ \ + if (RB_LEFT(elm, field)) { \ + elm = RB_LEFT(elm, field); \ + while (RB_RIGHT(elm, field)) \ + elm = RB_RIGHT(elm, field); \ + } else { \ + if (RB_PARENT(elm, field) && \ + (elm == RB_RIGHT(RB_PARENT(elm, field), field))) \ + elm = RB_PARENT(elm, field); \ + else { \ + while (RB_PARENT(elm, field) && \ + (elm == RB_LEFT(RB_PARENT(elm, field), field)))\ + elm = RB_PARENT(elm, field); \ + elm = RB_PARENT(elm, field); \ + } \ + } \ + return (elm); \ +} + +#define RB_GENERATE_MINMAX(name, type, field, attr) \ +attr struct type * \ +name##_RB_MINMAX(struct name *head, int val) \ +{ \ + struct type *tmp = RB_ROOT(head); \ + struct type *parent = NULL; \ + while (tmp) { \ + parent = tmp; \ + if (val < 0) \ + tmp = RB_LEFT(tmp, field); \ + else \ + tmp = RB_RIGHT(tmp, field); \ + } \ + return (parent); \ +} + +#define RB_NEGINF -1 +#define RB_INF 1 + +#define RB_INSERT(name, x, y) name##_RB_INSERT(x, y) +#define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y) +#define RB_FIND(name, x, y) name##_RB_FIND(x, y) +#define RB_NFIND(name, x, y) name##_RB_NFIND(x, y) +#define RB_NEXT(name, x, y) name##_RB_NEXT(y) +#define RB_PREV(name, x, y) name##_RB_PREV(y) +#define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF) +#define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF) + +#define RB_FOREACH(x, name, head) \ + for ((x) = RB_MIN(name, head); \ + (x) != NULL; \ + (x) = name##_RB_NEXT(x)) + +#define RB_FOREACH_FROM(x, name, y) \ + for ((x) = (y); \ + ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \ + (x) = (y)) + +#define RB_FOREACH_SAFE(x, name, head, y) \ + for ((x) = RB_MIN(name, head); \ + ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \ + (x) = (y)) + +#define RB_FOREACH_REVERSE(x, name, head) \ + for ((x) = RB_MAX(name, head); \ + (x) != NULL; \ + (x) = name##_RB_PREV(x)) + +#define RB_FOREACH_REVERSE_FROM(x, name, y) \ + for ((x) = (y); \ + ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \ + (x) = (y)) + +#define RB_FOREACH_REVERSE_SAFE(x, name, head, y) \ + for ((x) = RB_MAX(name, head); \ + ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \ + (x) = (y)) + +#endif /* _SYS_TREE_H_ */ From c596f5b73c09a914fdaa12c9098d75d7a49e7fde Mon Sep 17 00:00:00 2001 From: Takashi Yano Date: Wed, 25 Mar 2015 20:42:38 +0900 Subject: [PATCH 010/109] TIOCPKT mode of PTY is broken if ONLCR bit is cleared. * tty.h (class tty_min): Remove variable "write_error" to which any errors are not currently set at anywhere. (class tty): Add variable "column" for handling ONOCR. * tty.cc (tty::init): Add initialization code for variable "column". * fhandler.h (class fhandler_pty_master): Remove variable "need_nl" which is not necessary any more. "need_nl" was needed by OPOST process in fhandler_pty_master::process_slave_output(). (class fhandler_pty_common): Add function process_opost_output() for handling post processing for OPOST in write process. * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Count TIOCPKT control byte into length to be read in TIOCPKT mode. Move post processing for OPOST to write process. Remove code related to variable "write_error". Return with EIO error if slave is already closed. (fhandler_pty_master::fhandler_pty_master): Remove initialization code for variable "need_nl". (fhandler_pty_common::process_opost_output): Add this function for handling of OPOST in write process. Add code to avoid blocking in non-blocking mode when output is suspended by ^S. (fhandler_pty_slave::write): Call fhandler_pty_common:: process_opost_output() instead of WriteFile(). Remove code related to variable "write_error". (fhandler_pty_master::doecho): Call fhandler_pty_common:: process_opost_output() instead of WriteFile(). * select.cc (peek_pipe): Remove code related to variable "need_nl". Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 28 ++++ winsup/cygwin/fhandler.h | 5 +- winsup/cygwin/fhandler_tty.cc | 255 +++++++++++++++++----------------- winsup/cygwin/release/1.7.36 | 4 + winsup/cygwin/select.cc | 5 - winsup/cygwin/tty.cc | 1 + winsup/cygwin/tty.h | 2 +- 7 files changed, 168 insertions(+), 132 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index a7fc6f9c4..46baa0433 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,31 @@ +2015-03-25 Takashi Yano + + * tty.h (class tty_min): Remove variable "write_error" to which any + errors are not currently set at anywhere. + (class tty): Add variable "column" for handling ONOCR. + * tty.cc (tty::init): Add initialization code for variable "column". + * fhandler.h (class fhandler_pty_master): Remove variable "need_nl" + which is not necessary any more. "need_nl" was needed by OPOST process + in fhandler_pty_master::process_slave_output(). + (class fhandler_pty_common): Add function process_opost_output() for + handling post processing for OPOST in write process. + * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Count + TIOCPKT control byte into length to be read in TIOCPKT mode. Move + post processing for OPOST to write process. Remove code related to + variable "write_error". Return with EIO error if slave is already + closed. + (fhandler_pty_master::fhandler_pty_master): Remove initialization + code for variable "need_nl". + (fhandler_pty_common::process_opost_output): Add this function for + handling of OPOST in write process. Add code to avoid blocking in + non-blocking mode when output is suspended by ^S. + (fhandler_pty_slave::write): Call fhandler_pty_common:: + process_opost_output() instead of WriteFile(). Remove code related to + variable "write_error". + (fhandler_pty_master::doecho): Call fhandler_pty_common:: + process_opost_output() instead of WriteFile(). + * select.cc (peek_pipe): Remove code related to variable "need_nl". + 2015-03-24 Corinna Vinschen Per glibc BZ #15366: diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 4ec7d02fa..694c23bdd 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -1508,6 +1508,9 @@ class fhandler_pty_common: public fhandler_termios copyto (fh); return fh; } + + protected: + BOOL process_opost_output (HANDLE h, const void *ptr, ssize_t& len, bool is_echo); }; class fhandler_pty_slave: public fhandler_pty_common @@ -1574,8 +1577,6 @@ class fhandler_pty_master: public fhandler_pty_common DWORD dwProcessId; // Owner of master handles public: - int need_nl; // Next read should start with \n - HANDLE get_echo_handle () const { return echo_r; } /* Constructor */ fhandler_pty_master (int); diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 87bd6a0aa..89cc9e555 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -145,7 +145,8 @@ fhandler_pty_common::__release_output_mutex (const char *fn, int ln) void fhandler_pty_master::doecho (const void *str, DWORD len) { - if (!WriteFile (echo_w, str, len, &len, NULL)) + ssize_t towrite = len; + if (!process_opost_output (echo_w, str, towrite, true)) termios_printf ("Write to echo pipe failed, %E"); } @@ -217,10 +218,9 @@ int fhandler_pty_master::process_slave_output (char *buf, size_t len, int pktmode_on) { size_t rlen; - char outbuf[OUT_BUFFER_SIZE + 1]; + char outbuf[OUT_BUFFER_SIZE]; DWORD n; DWORD echo_cnt; - int column = 0; int rc = 0; flush_to_slave (); @@ -228,34 +228,8 @@ fhandler_pty_master::process_slave_output (char *buf, size_t len, int pktmode_on if (len == 0) goto out; - if (need_nl) - { - /* We need to return a left over \n character, resulting from - \r\n conversion. Note that we already checked for FLUSHO and - output_stopped at the time that we read the character, so we - don't check again here. */ - if (buf) - buf[0] = '\n'; - need_nl = 0; - rc = 1; - goto out; - } - for (;;) { - /* Set RLEN to the number of bytes to read from the pipe. */ - rlen = len; - if (get_ttyp ()->ti.c_oflag & OPOST && get_ttyp ()->ti.c_oflag & ONLCR) - { - /* We are going to expand \n to \r\n, so don't read more than - half of the number of bytes requested. */ - rlen /= 2; - if (rlen == 0) - rlen = 1; - } - if (rlen > sizeof outbuf) - rlen = sizeof outbuf; - n = echo_cnt = 0; for (;;) { @@ -267,7 +241,11 @@ fhandler_pty_master::process_slave_output (char *buf, size_t len, int pktmode_on if (n) break; if (hit_eof ()) - goto out; + { + set_errno (EIO); + rc = -1; + goto out; + } /* DISCARD (FLUSHO) and tcflush can finish here. */ if ((get_ttyp ()->ti.c_lflag & FLUSHO || !buf)) goto out; @@ -289,6 +267,26 @@ fhandler_pty_master::process_slave_output (char *buf, size_t len, int pktmode_on flush_to_slave (); } + /* Set RLEN to the number of bytes to read from the pipe. */ + rlen = len; + + char *optr; + optr = buf; + if (pktmode_on && buf) + { + *optr++ = TIOCPKT_DATA; + rlen -= 1; + } + + if (rlen == 0) + { + rc = optr - buf; + goto out; + } + + if (rlen > sizeof outbuf) + rlen = sizeof outbuf; + /* If echo pipe has data (something has been typed or pasted), prefer it over slave output. */ if (echo_cnt > 0) @@ -306,68 +304,12 @@ fhandler_pty_master::process_slave_output (char *buf, size_t len, int pktmode_on } termios_printf ("bytes read %u", n); - get_ttyp ()->write_error = 0; if (get_ttyp ()->ti.c_lflag & FLUSHO || !buf) continue; - char *optr; - optr = buf; - if (pktmode_on) - *optr++ = TIOCPKT_DATA; - - if (!(get_ttyp ()->ti.c_oflag & OPOST)) // post-process output - { - memcpy (optr, outbuf, n); - optr += n; - } - else // raw output mode - { - char *iptr = outbuf; - - while (n--) - { - switch (*iptr) - { - case '\r': - if ((get_ttyp ()->ti.c_oflag & ONOCR) && column == 0) - { - iptr++; - continue; - } - if (get_ttyp ()->ti.c_oflag & OCRNL) - *iptr = '\n'; - else - column = 0; - break; - case '\n': - if (get_ttyp ()->ti.c_oflag & ONLCR) - { - *optr++ = '\r'; - column = 0; - } - if (get_ttyp ()->ti.c_oflag & ONLRET) - column = 0; - break; - default: - column++; - break; - } - - /* Don't store data past the end of the user's buffer. This - can happen if the user requests a read of 1 byte when - doing \r\n expansion. */ - if (optr - buf >= (int) len) - { - if (*iptr != '\n' || n != 0) - system_printf ("internal error: %u unexpected characters", n); - need_nl = 1; - break; - } - - *optr++ = *iptr++; - } - } + memcpy (optr, outbuf, n); + optr += n; rc = optr - buf; break; @@ -639,7 +581,6 @@ fhandler_pty_slave::init (HANDLE h, DWORD a, mode_t) ssize_t __stdcall fhandler_pty_slave::write (const void *ptr, size_t len) { - DWORD n; ssize_t towrite = len; bg_check_types bg = bg_check (SIGTTOU); @@ -650,43 +591,19 @@ fhandler_pty_slave::write (const void *ptr, size_t len) push_process_state process_state (PID_TTYOU); - while (len) + if (!process_opost_output (get_output_handle (), ptr, towrite, false)) { - n = MIN (OUT_BUFFER_SIZE, len); - char *buf = (char *)ptr; - ptr = (char *) ptr + n; - len -= n; - - while (tc ()->output_stopped) - cygwait (10); - - /* Previous write may have set write_error to != 0. Check it here. - This is less than optimal, but the alternative slows down pty - writes enormously. */ - if (get_ttyp ()->write_error) + DWORD err = GetLastError (); + termios_printf ("WriteFile failed, %E"); + switch (err) { - set_errno (get_ttyp ()->write_error); - towrite = -1; - get_ttyp ()->write_error = 0; - break; - } - - BOOL res = WriteFile (get_output_handle (), buf, n, &n, NULL); - if (!res) - { - DWORD err = GetLastError (); - termios_printf ("WriteFile failed, %E"); - switch (err) - { - case ERROR_NO_DATA: - err = ERROR_IO_DEVICE; - default: - __seterrno_from_win_error (err); - } - raise (SIGHUP); /* FIXME: Should this be SIGTTOU? */ - towrite = -1; - break; + case ERROR_NO_DATA: + err = ERROR_IO_DEVICE; + default: + __seterrno_from_win_error (err); } + raise (SIGHUP); /* FIXME: Should this be SIGTTOU? */ + towrite = -1; } return towrite; } @@ -1225,7 +1142,7 @@ errout: fhandler_pty_master::fhandler_pty_master (int unit) : fhandler_pty_common (), pktmode (0), master_ctl (NULL), master_thread (NULL), from_master (NULL), to_master (NULL), - echo_r (NULL), echo_w (NULL), dwProcessId (0), need_nl (0) + echo_r (NULL), echo_w (NULL), dwProcessId (0) { if (unit >= 0) dev ().parse (DEV_PTYM_MAJOR, unit); @@ -1783,3 +1700,93 @@ fhandler_pty_master::fixup_after_exec () else from_master = to_master = NULL; } + +BOOL +fhandler_pty_common::process_opost_output (HANDLE h, const void *ptr, ssize_t& len, bool is_echo) +{ + ssize_t towrite = len; + BOOL res = TRUE; + while (towrite) + { + if (!is_echo) + { + if (tc ()->output_stopped && is_nonblocking ()) + { + if (towrite < len) + break; + else + { + set_errno(EAGAIN); + len = -1; + return TRUE; + } + } + while (tc ()->output_stopped) + cygwait (10); + } + + if (!(get_ttyp ()->ti.c_oflag & OPOST)) // raw output mode + { + DWORD n = MIN (OUT_BUFFER_SIZE, towrite); + res = WriteFile (h, ptr, n, &n, NULL); + if (!res) + break; + ptr = (char *) ptr + n; + towrite -= n; + } + else // post-process output + { + char outbuf[OUT_BUFFER_SIZE + 1]; + char *buf = (char *)ptr; + DWORD n = 0; + ssize_t rc = 0; + acquire_output_mutex (INFINITE); + while (n < OUT_BUFFER_SIZE && rc < towrite) + { + switch (buf[rc]) + { + case '\r': + if ((get_ttyp ()->ti.c_oflag & ONOCR) + && get_ttyp ()->column == 0) + { + rc++; + continue; + } + if (get_ttyp ()->ti.c_oflag & OCRNL) + { + outbuf[n++] = '\n'; + rc++; + } + else + { + outbuf[n++] = buf[rc++]; + get_ttyp ()->column = 0; + } + break; + case '\n': + if (get_ttyp ()->ti.c_oflag & ONLCR) + { + outbuf[n++] = '\r'; + get_ttyp ()->column = 0; + } + if (get_ttyp ()->ti.c_oflag & ONLRET) + get_ttyp ()->column = 0; + outbuf[n++] = buf[rc++]; + break; + default: + outbuf[n++] = buf[rc++]; + get_ttyp ()->column++; + break; + } + } + release_output_mutex (); + res = WriteFile (h, outbuf, n, &n, NULL); + if (!res) + break; + ptr = (char *) ptr + rc; + towrite -= rc; + } + } + len -= towrite; + return res; +} diff --git a/winsup/cygwin/release/1.7.36 b/winsup/cygwin/release/1.7.36 index 28797779a..e9cfc6154 100644 --- a/winsup/cygwin/release/1.7.36 +++ b/winsup/cygwin/release/1.7.36 @@ -18,3 +18,7 @@ Bug Fixes - Fix a name change from symlink to target name in calls to execvp, system, etc. Addresses: https://cygwin.com/ml/cygwin/2015-03/msg00270.html + +- Fix internal error in pty -ONLCR handling. Fix timing bug in pty OPOST + handling. + Addresses: https://cygwin.com/ml/cygwin/2015-02/msg00929.html diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 17a32a367..1706c87c8 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -604,11 +604,6 @@ peek_pipe (select_record *s, bool from_select) { fhandler_pty_master *fhm = (fhandler_pty_master *) fh; fhm->flush_to_slave (); - if (fhm->need_nl) - { - gotone = s->read_ready = true; - goto out; - } } break; default: diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc index 01c53f933..7de0fa91c 100644 --- a/winsup/cygwin/tty.cc +++ b/winsup/cygwin/tty.cc @@ -237,6 +237,7 @@ tty::init () was_opened = false; master_pid = 0; is_console = false; + column = 0; } HANDLE diff --git a/winsup/cygwin/tty.h b/winsup/cygwin/tty.h index c52f26307..9790a365a 100644 --- a/winsup/cygwin/tty.h +++ b/winsup/cygwin/tty.h @@ -67,7 +67,6 @@ public: * -ERRNO */ int ioctl_retval; - int write_error; void setntty (_major_t t, _minor_t n) {ntty = (fh_devices) FHDEV (t, n);} dev_t getntty () const {return ntty;} @@ -117,6 +116,7 @@ public: int read_retval; bool was_opened; /* True if opened at least once. */ + int column; /* Current Column */ void init (); HANDLE open_inuse (ACCESS_MASK access); From 842983ce046e81788a85dc126fd373dc6c21039d Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 25 Mar 2015 17:16:52 +0100 Subject: [PATCH 011/109] Bump tty.cc copyright date --- winsup/cygwin/tty.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc index 7de0fa91c..3f1077dd9 100644 --- a/winsup/cygwin/tty.cc +++ b/winsup/cygwin/tty.cc @@ -1,7 +1,7 @@ /* tty.cc Copyright 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, - 2010, 2011, 2012 Red Hat, Inc. + 2010, 2011, 2012, 2013, 2015 Red Hat, Inc. This file is part of Cygwin. From 13681ab7f16453ab523538af0f05e83da2046aa3 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 25 Mar 2015 17:21:38 +0100 Subject: [PATCH 012/109] Add CMIN and CTIME definitions * include/sys/termios.h: Add CMIN and CTIME. * fhandler_termios.cc (fhandler_termios::tcinit): Use CMIN and CTIME. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/fhandler_termios.cc | 6 +++--- winsup/cygwin/include/sys/termios.h | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 46baa0433..869beeed2 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-03-25 Corinna Vinschen + + * include/sys/termios.h: Add CMIN and CTIME. + * fhandler_termios.cc (fhandler_termios::tcinit): Use CMIN and CTIME. + 2015-03-25 Takashi Yano * tty.h (class tty_min): Remove variable "write_error" to which any diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc index 99b661eee..983e2f99e 100644 --- a/winsup/cygwin/fhandler_termios.cc +++ b/winsup/cygwin/fhandler_termios.cc @@ -1,7 +1,7 @@ /* fhandler_termios.cc Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010, - 2011, 2012, 2014 Red Hat, Inc. + 2011, 2012, 2014, 2015 Red Hat, Inc. This file is part of Cygwin. @@ -46,14 +46,14 @@ fhandler_termios::tcinit (bool is_pty_master) tc ()->ti.c_cc[VINTR] = CINTR; tc ()->ti.c_cc[VKILL] = CKILL; tc ()->ti.c_cc[VLNEXT] = CLNEXT; - tc ()->ti.c_cc[VMIN] = 1; + tc ()->ti.c_cc[VMIN] = CMIN; tc ()->ti.c_cc[VQUIT] = CQUIT; tc ()->ti.c_cc[VREPRINT] = CRPRNT; tc ()->ti.c_cc[VSTART] = CSTART; tc ()->ti.c_cc[VSTOP] = CSTOP; tc ()->ti.c_cc[VSUSP] = CSUSP; tc ()->ti.c_cc[VSWTC] = CSWTCH; - tc ()->ti.c_cc[VTIME] = 0; + tc ()->ti.c_cc[VTIME] = CTIME; tc ()->ti.c_cc[VWERASE] = CWERASE; tc ()->ti.c_ispeed = tc ()->ti.c_ospeed = B38400; diff --git a/winsup/cygwin/include/sys/termios.h b/winsup/cygwin/include/sys/termios.h index 687c0085e..fb6f3851b 100644 --- a/winsup/cygwin/include/sys/termios.h +++ b/winsup/cygwin/include/sys/termios.h @@ -1,7 +1,7 @@ /* sys/termios.h Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. + 2008, 2009, 2010, 2011, 2012, 2015 Red Hat, Inc. This file is part of Cygwin. @@ -99,6 +99,8 @@ POSIX commands */ #define CDISCARD CFLUSH #define CWERASE CTRL('W') #define CLNEXT CTRL('V') +#define CMIN 1 +#define CTIME 0 /* iflag bits */ #define IGNBRK 0x00001 From 40b1aa400824382ba15a2545f8124deb3516b8a8 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 30 Mar 2015 16:53:52 +0200 Subject: [PATCH 013/109] Prepare to rename/reuse struct ucontext. * cygtls.h (struct _cygtls): Convert thread_context to type CONTEXT. * exceptions.cc (_cygtls::signal_debugger): Use sizeof (CONTEXT) for size of CONTEXT copied for GDB's digestion. * include/cygwin/signal.h: Add a preliminary comment. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 7 ++ winsup/cygwin/cygtls.h | 4 +- winsup/cygwin/exceptions.cc | 7 +- winsup/cygwin/include/cygwin/signal.h | 6 +- winsup/cygwin/tlsoffsets.h | 104 +++++++++++++------------- winsup/cygwin/tlsoffsets64.h | 104 +++++++++++++------------- 6 files changed, 120 insertions(+), 112 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 869beeed2..505f4ce62 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2015-03-30 Corinna Vinschen + + * cygtls.h (struct _cygtls): Convert thread_context to type CONTEXT. + * exceptions.cc (_cygtls::signal_debugger): Use sizeof (CONTEXT) for + size of CONTEXT copied for GDB's digestion. + * include/cygwin/signal.h: Add a preliminary comment. + 2015-03-25 Corinna Vinschen * include/sys/termios.h: Add CMIN and CTIME. diff --git a/winsup/cygwin/cygtls.h b/winsup/cygwin/cygtls.h index 91533f2a0..97e403dea 100644 --- a/winsup/cygwin/cygtls.h +++ b/winsup/cygwin/cygtls.h @@ -1,7 +1,7 @@ /* cygtls.h Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, - 2014 Red Hat, Inc. + 2014, 2015 Red Hat, Inc. This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for @@ -191,7 +191,7 @@ public: siginfo_t *sigwait_info; HANDLE signal_arrived; bool will_wait_for_signal; - struct ucontext thread_context; + CONTEXT thread_context; DWORD thread_id; siginfo_t infodata; struct pthread *tid; diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 3af9a54da..af534574b 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1,7 +1,7 @@ /* exceptions.cc - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Red Hat, Inc. This file is part of Cygwin. @@ -1526,8 +1526,7 @@ _cygtls::signal_debugger (siginfo_t& si) #else c.Eip = retaddr (); #endif - memcpy (&thread_context, &c, (&thread_context._internal - - (unsigned char *) &thread_context)); + memcpy (&thread_context, &c, sizeof (CONTEXT)); /* Enough space for 32/64 bit addresses */ char sigmsg[2 * sizeof (_CYGWIN_SIGNAL_STRING " ffffffff ffffffffffffffff")]; __small_sprintf (sigmsg, _CYGWIN_SIGNAL_STRING " %d %y %p", si.si_signo, diff --git a/winsup/cygwin/include/cygwin/signal.h b/winsup/cygwin/include/cygwin/signal.h index 3d74c9c8d..58bbff059 100644 --- a/winsup/cygwin/include/cygwin/signal.h +++ b/winsup/cygwin/include/cygwin/signal.h @@ -1,7 +1,7 @@ /* signal.h - Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012, 2013 - Red Hat, Inc. + Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012, 2013, + 2015 Red Hat, Inc. This file is part of Cygwin. @@ -149,6 +149,8 @@ struct ucontext #endif /* !x86_64 */ +/* Needed for GDB. It only compiles in the context copy code if this + macro s defined. */ #define __COPY_CONTEXT_SIZE ((size_t) (uintptr_t) &((struct ucontext *) 0)->_internal) typedef union sigval diff --git a/winsup/cygwin/tlsoffsets.h b/winsup/cygwin/tlsoffsets.h index 572dfb7b7..a74e22f69 100644 --- a/winsup/cygwin/tlsoffsets.h +++ b/winsup/cygwin/tlsoffsets.h @@ -31,32 +31,32 @@ //; $tls::pwill_wait_for_signal = 2848; //; $tls::thread_context = -9848; //; $tls::pthread_context = 2852; -//; $tls::thread_id = -9636; -//; $tls::pthread_id = 3064; -//; $tls::infodata = -9632; -//; $tls::pinfodata = 3068; -//; $tls::tid = -9484; -//; $tls::ptid = 3216; -//; $tls::_ctinfo = -9480; -//; $tls::p_ctinfo = 3220; -//; $tls::andreas = -9476; -//; $tls::pandreas = 3224; -//; $tls::wq = -9472; -//; $tls::pwq = 3228; -//; $tls::sig = -9444; -//; $tls::psig = 3256; -//; $tls::incyg = -9440; -//; $tls::pincyg = 3260; -//; $tls::spinning = -9436; -//; $tls::pspinning = 3264; -//; $tls::stacklock = -9432; -//; $tls::pstacklock = 3268; -//; $tls::stackptr = -9428; -//; $tls::pstackptr = 3272; -//; $tls::stack = -9424; -//; $tls::pstack = 3276; -//; $tls::initialized = -8400; -//; $tls::pinitialized = 4300; +//; $tls::thread_id = -9132; +//; $tls::pthread_id = 3568; +//; $tls::infodata = -9128; +//; $tls::pinfodata = 3572; +//; $tls::tid = -8980; +//; $tls::ptid = 3720; +//; $tls::_ctinfo = -8976; +//; $tls::p_ctinfo = 3724; +//; $tls::andreas = -8972; +//; $tls::pandreas = 3728; +//; $tls::wq = -8968; +//; $tls::pwq = 3732; +//; $tls::sig = -8940; +//; $tls::psig = 3760; +//; $tls::incyg = -8936; +//; $tls::pincyg = 3764; +//; $tls::spinning = -8932; +//; $tls::pspinning = 3768; +//; $tls::stacklock = -8928; +//; $tls::pstacklock = 3772; +//; $tls::stackptr = -8924; +//; $tls::pstackptr = 3776; +//; $tls::stack = -8920; +//; $tls::pstack = 3780; +//; $tls::initialized = -7896; +//; $tls::pinitialized = 4804; //; __DATA__ #define tls_locals (-12700) @@ -89,29 +89,29 @@ #define tls_pwill_wait_for_signal (2848) #define tls_thread_context (-9848) #define tls_pthread_context (2852) -#define tls_thread_id (-9636) -#define tls_pthread_id (3064) -#define tls_infodata (-9632) -#define tls_pinfodata (3068) -#define tls_tid (-9484) -#define tls_ptid (3216) -#define tls__ctinfo (-9480) -#define tls_p_ctinfo (3220) -#define tls_andreas (-9476) -#define tls_pandreas (3224) -#define tls_wq (-9472) -#define tls_pwq (3228) -#define tls_sig (-9444) -#define tls_psig (3256) -#define tls_incyg (-9440) -#define tls_pincyg (3260) -#define tls_spinning (-9436) -#define tls_pspinning (3264) -#define tls_stacklock (-9432) -#define tls_pstacklock (3268) -#define tls_stackptr (-9428) -#define tls_pstackptr (3272) -#define tls_stack (-9424) -#define tls_pstack (3276) -#define tls_initialized (-8400) -#define tls_pinitialized (4300) +#define tls_thread_id (-9132) +#define tls_pthread_id (3568) +#define tls_infodata (-9128) +#define tls_pinfodata (3572) +#define tls_tid (-8980) +#define tls_ptid (3720) +#define tls__ctinfo (-8976) +#define tls_p_ctinfo (3724) +#define tls_andreas (-8972) +#define tls_pandreas (3728) +#define tls_wq (-8968) +#define tls_pwq (3732) +#define tls_sig (-8940) +#define tls_psig (3760) +#define tls_incyg (-8936) +#define tls_pincyg (3764) +#define tls_spinning (-8932) +#define tls_pspinning (3768) +#define tls_stacklock (-8928) +#define tls_pstacklock (3772) +#define tls_stackptr (-8924) +#define tls_pstackptr (3776) +#define tls_stack (-8920) +#define tls_pstack (3780) +#define tls_initialized (-7896) +#define tls_pinitialized (4804) diff --git a/winsup/cygwin/tlsoffsets64.h b/winsup/cygwin/tlsoffsets64.h index 991280663..e43dea7e2 100644 --- a/winsup/cygwin/tlsoffsets64.h +++ b/winsup/cygwin/tlsoffsets64.h @@ -31,32 +31,32 @@ //; $tls::pwill_wait_for_signal = 4136; //; $tls::thread_context = -8656; //; $tls::pthread_context = 4144; -//; $tls::thread_id = -7824; -//; $tls::pthread_id = 4976; -//; $tls::infodata = -7820; -//; $tls::pinfodata = 4980; -//; $tls::tid = -7672; -//; $tls::ptid = 5128; -//; $tls::_ctinfo = -7664; -//; $tls::p_ctinfo = 5136; -//; $tls::andreas = -7656; -//; $tls::pandreas = 5144; -//; $tls::wq = -7648; -//; $tls::pwq = 5152; -//; $tls::sig = -7600; -//; $tls::psig = 5200; -//; $tls::incyg = -7596; -//; $tls::pincyg = 5204; -//; $tls::spinning = -7592; -//; $tls::pspinning = 5208; -//; $tls::stacklock = -7588; -//; $tls::pstacklock = 5212; -//; $tls::stackptr = -7584; -//; $tls::pstackptr = 5216; -//; $tls::stack = -7576; -//; $tls::pstack = 5224; -//; $tls::initialized = -5528; -//; $tls::pinitialized = 7272; +//; $tls::thread_id = -7424; +//; $tls::pthread_id = 5376; +//; $tls::infodata = -7420; +//; $tls::pinfodata = 5380; +//; $tls::tid = -7272; +//; $tls::ptid = 5528; +//; $tls::_ctinfo = -7264; +//; $tls::p_ctinfo = 5536; +//; $tls::andreas = -7256; +//; $tls::pandreas = 5544; +//; $tls::wq = -7248; +//; $tls::pwq = 5552; +//; $tls::sig = -7200; +//; $tls::psig = 5600; +//; $tls::incyg = -7196; +//; $tls::pincyg = 5604; +//; $tls::spinning = -7192; +//; $tls::pspinning = 5608; +//; $tls::stacklock = -7188; +//; $tls::pstacklock = 5612; +//; $tls::stackptr = -7184; +//; $tls::pstackptr = 5616; +//; $tls::stack = -7176; +//; $tls::pstack = 5624; +//; $tls::initialized = -5128; +//; $tls::pinitialized = 7672; //; __DATA__ #define tls_locals (-12800) @@ -89,29 +89,29 @@ #define tls_pwill_wait_for_signal (4136) #define tls_thread_context (-8656) #define tls_pthread_context (4144) -#define tls_thread_id (-7824) -#define tls_pthread_id (4976) -#define tls_infodata (-7820) -#define tls_pinfodata (4980) -#define tls_tid (-7672) -#define tls_ptid (5128) -#define tls__ctinfo (-7664) -#define tls_p_ctinfo (5136) -#define tls_andreas (-7656) -#define tls_pandreas (5144) -#define tls_wq (-7648) -#define tls_pwq (5152) -#define tls_sig (-7600) -#define tls_psig (5200) -#define tls_incyg (-7596) -#define tls_pincyg (5204) -#define tls_spinning (-7592) -#define tls_pspinning (5208) -#define tls_stacklock (-7588) -#define tls_pstacklock (5212) -#define tls_stackptr (-7584) -#define tls_pstackptr (5216) -#define tls_stack (-7576) -#define tls_pstack (5224) -#define tls_initialized (-5528) -#define tls_pinitialized (7272) +#define tls_thread_id (-7424) +#define tls_pthread_id (5376) +#define tls_infodata (-7420) +#define tls_pinfodata (5380) +#define tls_tid (-7272) +#define tls_ptid (5528) +#define tls__ctinfo (-7264) +#define tls_p_ctinfo (5536) +#define tls_andreas (-7256) +#define tls_pandreas (5544) +#define tls_wq (-7248) +#define tls_pwq (5552) +#define tls_sig (-7200) +#define tls_psig (5600) +#define tls_incyg (-7196) +#define tls_pincyg (5604) +#define tls_spinning (-7192) +#define tls_pspinning (5608) +#define tls_stacklock (-7188) +#define tls_pstacklock (5612) +#define tls_stackptr (-7184) +#define tls_pstackptr (5616) +#define tls_stack (-7176) +#define tls_pstack (5624) +#define tls_initialized (-5128) +#define tls_pinitialized (7672) From 98209e8e304e40a352bac5703a597ed66628d084 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 30 Mar 2015 18:05:06 +0200 Subject: [PATCH 014/109] Try best to handle user from domain not in trusted domain list. * cygheap.h (cygheap_domain_info::add_domain): Add prototype. * uinfo.cc (cygheap_domain_info::add_domain): New method. (pwdgrp::fetch_account_from_windows): Try to add domain explicitely if it was not in the original list of trusted domains and go ahead rather than bailing out. Add comment to explain why. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/cygheap.h | 1 + winsup/cygwin/uinfo.cc | 40 ++++++++++++++++++++++++++++++++++++---- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 505f4ce62..20ad60671 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2015-03-30 Corinna Vinschen + + * cygheap.h (cygheap_domain_info::add_domain): Add prototype. + * uinfo.cc (cygheap_domain_info::add_domain): New method. + (pwdgrp::fetch_account_from_windows): Try to add domain explicitely + if it was not in the original list of trusted domains and go ahead + rather than bailing out. Add comment to explain why. + 2015-03-30 Corinna Vinschen * cygtls.h (struct _cygtls): Convert thread_context to type CONTEXT. diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h index 6fb7a063b..fd848144f 100644 --- a/winsup/cygwin/cygheap.h +++ b/winsup/cygwin/cygheap.h @@ -393,6 +393,7 @@ public: inline PDS_DOMAIN_TRUSTSW trusted_domain (ULONG idx) const { return (idx < tdom_count) ? tdom + idx : NULL; } + PDS_DOMAIN_TRUSTSW add_domain (PCWSTR, PSID); inline PWCHAR get_rfc2307_domain () const { return rfc2307_domain_buf ?: NULL; } diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index b1025b02c..f78e484dd 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -1428,6 +1428,29 @@ cygheap_domain_info::init () return true; } +PDS_DOMAIN_TRUSTSW +cygheap_domain_info::add_domain (PCWSTR domain, PSID sid) +{ + PDS_DOMAIN_TRUSTSW new_tdom; + cygsid tsid (sid); + + new_tdom = (PDS_DOMAIN_TRUSTSW) crealloc (tdom, (tdom_count + 1) + * sizeof (DS_DOMAIN_TRUSTSW)); + if (!new_tdom) + return NULL; + + tdom = new_tdom; + new_tdom = &tdom[tdom_count]; + new_tdom->DnsDomainName = new_tdom->NetbiosDomainName = cwcsdup (domain); + --*RtlSubAuthorityCountSid (tsid); + ULONG len = RtlLengthSid (tsid); + new_tdom->DomainSid = cmalloc_abort(HEAP_BUF, len); + RtlCopySid (len, new_tdom->DomainSid, tsid); + new_tdom->PosixOffset = 0; + ++tdom_count; + return new_tdom; +} + /* Per session, so it changes potentially when switching the user context. */ static cygsid logon_sid (""); @@ -2135,16 +2158,25 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap) if (!wcscasecmp (dom, td->NetbiosDomainName)) { domain = td->DnsDomainName; - posix_offset = - fetch_posix_offset (td, &loc_ldap); break; } - if (!domain) { + /* This shouldn't happen, in theory, but it does. There + are cases where the user's logon domain does not show + up in the list of trusted domains. We're desperately + trying to workaround that here bu adding an entry for + this domain to the trusted domains and ask the DC for + a posix_offset. There's a good chance this doesn't + work either, but at least we tried, and the user can + work. */ debug_printf ("Unknown domain %W", dom); - return NULL; + td = cygheap->dom.add_domain (dom, sid); + if (td) + domain = td->DnsDomainName; } + if (domain) + posix_offset = fetch_posix_offset (td, &loc_ldap); } } /* If the domain returned by LookupAccountSid is not our machine From 779ddb0b4874afc80c13cb1c2afe45c68db2fdce Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 25 Mar 2015 18:19:38 -0500 Subject: [PATCH 015/109] string: add GNU basename(3) * libc/include/libgen.h (_BASENAME_DEFINED): Define. * libc/include/string.h (basename): Declare. * libc/string/Makefile.am (ELIX_4_SOURCES): Add gnu_basename.c. * libc/string/Makefile.in: Regenerate. * libc/string/gnu_basename.c: New file. --- newlib/ChangeLog | 8 ++++++++ newlib/libc/include/libgen.h | 1 + newlib/libc/include/string.h | 14 ++++++++++++++ newlib/libc/string/Makefile.am | 1 + newlib/libc/string/Makefile.in | 13 +++++++++++-- newlib/libc/string/gnu_basename.c | 26 ++++++++++++++++++++++++++ 6 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 newlib/libc/string/gnu_basename.c diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 8ded7abde..7c57c94cd 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,11 @@ +2015-03-30 Yaakov Selkowitz + + * libc/include/libgen.h (_BASENAME_DEFINED): Define. + * libc/include/string.h (basename): Declare. + * libc/string/Makefile.am (ELIX_4_SOURCES): Add gnu_basename.c. + * libc/string/Makefile.in: Regenerate. + * libc/string/gnu_basename.c: New file. + 2015-03-23 Sebastian Huber * libc/include/sys/tree.h: New file. diff --git a/newlib/libc/include/libgen.h b/newlib/libc/include/libgen.h index abfab0e5c..8360a22f9 100644 --- a/newlib/libc/include/libgen.h +++ b/newlib/libc/include/libgen.h @@ -13,6 +13,7 @@ extern "C" { #endif char *_EXFUN(basename, (char *)); +#define _BASENAME_DEFINED char *_EXFUN(dirname, (char *)); #ifdef __cplusplus diff --git a/newlib/libc/include/string.h b/newlib/libc/include/string.h index 43b36267d..9e11e5c51 100644 --- a/newlib/libc/include/string.h +++ b/newlib/libc/include/string.h @@ -163,6 +163,20 @@ int _EXFUN(strtosigno, (const char *__name)); (char *) memcpy (__out, __in, __len-1);})) #endif /* _GNU_SOURCE && __GNUC__ */ +/* There are two common basename variants. If you #include + first, you get the POSIX version; otherwise you get the GNU version. + POSIX requires that #undef basename will still let you + invoke the underlying function, but that requires gcc support. */ +#if __GNU_VISIBLE && !defined(_BASENAME_DEFINED) +# ifdef __GNUC__ +char *_EXFUN(basename,(const char *)) + __asm__ (__ASMNAME ("__gnu_basename")) __nonnull(1); +# else +char *_EXFUN(__gnu_basename,(const char *)); +# define basename __gnu_basename +# endif +#endif + #include _END_STD_C diff --git a/newlib/libc/string/Makefile.am b/newlib/libc/string/Makefile.am index e9adbe169..e73bfdccd 100644 --- a/newlib/libc/string/Makefile.am +++ b/newlib/libc/string/Makefile.am @@ -102,6 +102,7 @@ if ELIX_LEVEL_3 ELIX_4_SOURCES = else ELIX_4_SOURCES = \ + gnu_basename.c \ memmem.c \ memrchr.c \ rawmemchr.c \ diff --git a/newlib/libc/string/Makefile.in b/newlib/libc/string/Makefile.in index 255ee0704..bcebcbd62 100644 --- a/newlib/libc/string/Makefile.in +++ b/newlib/libc/string/Makefile.in @@ -118,7 +118,8 @@ am__objects_1 = lib_a-bcopy.$(OBJEXT) lib_a-bzero.$(OBJEXT) \ @ELIX_LEVEL_1_FALSE@ lib_a-wcpcpy.$(OBJEXT) \ @ELIX_LEVEL_1_FALSE@ lib_a-wcpncpy.$(OBJEXT) \ @ELIX_LEVEL_1_FALSE@ lib_a-wcsdup.$(OBJEXT) -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_3 = lib_a-memmem.$(OBJEXT) \ +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_3 = lib_a-gnu_basename.$(OBJEXT) \ +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-memmem.$(OBJEXT) \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-memrchr.$(OBJEXT) \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-rawmemchr.$(OBJEXT) \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-wcscasecmp.$(OBJEXT) \ @@ -145,7 +146,8 @@ am__objects_4 = bcopy.lo bzero.lo index.lo memchr.lo memcmp.lo \ @ELIX_LEVEL_1_FALSE@ stpcpy.lo stpncpy.lo strndup.lo \ @ELIX_LEVEL_1_FALSE@ strcasestr.lo strchrnul.lo strndup_r.lo \ @ELIX_LEVEL_1_FALSE@ wcpcpy.lo wcpncpy.lo wcsdup.lo -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_6 = memmem.lo \ +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_6 = gnu_basename.lo \ +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ memmem.lo \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ memrchr.lo \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ rawmemchr.lo \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcscasecmp.lo \ @@ -410,6 +412,7 @@ GENERAL_SOURCES = \ @ELIX_LEVEL_1_TRUE@ELIX_2_SOURCES = @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ELIX_4_SOURCES = \ +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ gnu_basename.c \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ memmem.c \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ memrchr.c \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ rawmemchr.c \ @@ -998,6 +1001,12 @@ lib_a-wcsdup.o: wcsdup.c lib_a-wcsdup.obj: wcsdup.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsdup.obj `if test -f 'wcsdup.c'; then $(CYGPATH_W) 'wcsdup.c'; else $(CYGPATH_W) '$(srcdir)/wcsdup.c'; fi` +lib_a-gnu_basename.o: gnu_basename.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-gnu_basename.o `test -f 'gnu_basename.c' || echo '$(srcdir)/'`gnu_basename.c + +lib_a-gnu_basename.obj: gnu_basename.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-gnu_basename.obj `if test -f 'gnu_basename.c'; then $(CYGPATH_W) 'gnu_basename.c'; else $(CYGPATH_W) '$(srcdir)/gnu_basename.c'; fi` + lib_a-memmem.o: memmem.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memmem.o `test -f 'memmem.c' || echo '$(srcdir)/'`memmem.c diff --git a/newlib/libc/string/gnu_basename.c b/newlib/libc/string/gnu_basename.c new file mode 100644 index 000000000..46b92d0fd --- /dev/null +++ b/newlib/libc/string/gnu_basename.c @@ -0,0 +1,26 @@ +#ifndef _NO_BASENAME +/* Copyright 2015 Red Hat, Inc. + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +/* The differences with the POSIX version (unix/basename.c): + * - declared in (instead of ); + * - the argument is never modified, and therefore is marked const; + * - the empty string is returned if path is an empty string, "/", or ends + * with a trailing slash. + */ + +#include + +char * +_DEFUN (__gnu_basename, (path), + const char *path) +{ + char *p; + if ((p = strrchr (path, '/'))) + return p + 1; + return path; +} + +#endif /* !_NO_BASENAME */ From 1f9716e16068ef55a3776952dca9697a6949e14d Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 26 Mar 2015 00:20:15 -0500 Subject: [PATCH 016/109] cygwin: add GNU basename(3) winsup/cygwin/ * common.din (__gnu_basename): Export. * path.cc (__gnu_basename): New function. winsup/doc/ * posix.xml (std-gnu): Add basename. (std-notes): Add note about two forms of basename. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/common.din | 1 + winsup/cygwin/path.cc | 28 ++++++++++++++++++++++++++++ winsup/doc/ChangeLog | 5 +++++ winsup/doc/posix.xml | 6 +++++- 5 files changed, 44 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 20ad60671..f496ec73b 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-03-30 Yaakov Selkowitz + + * common.din (__gnu_basename): Export. + * path.cc (__gnu_basename): New function. + 2015-03-30 Corinna Vinschen * cygheap.h (cygheap_domain_info::add_domain): Add prototype. diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din index 42098ff30..f14b33107 100644 --- a/winsup/cygwin/common.din +++ b/winsup/cygwin/common.din @@ -61,6 +61,7 @@ __fsetlocking SIGFE __fwritable NOSIGFE __fwriting NOSIGFE __getreent NOSIGFE +__gnu_basename NOSIGFE __infinity NOSIGFE __isinfd NOSIGFE __isinff NOSIGFE diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 47c687fb7..b05333fd7 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -48,6 +48,7 @@ c: means c:\. */ +#define _BASENAME_DEFINED #include "winsup.h" #include "miscfuncs.h" #include @@ -4767,6 +4768,33 @@ basename (char *path) return path; } +/* The differences with the POSIX version above: + - declared in (instead of ); + - the argument is never modified, and therefore is marked const; + - the empty string is returned if path is an empty string, "/", or ends + with a trailing slash. */ +extern "C" char * +__gnu_basename (const char *path) +{ + static char buf[1]; + char *c, *d, *bs = (char *)path; + + if (!path || !*path) + return strcpy (buf, ""); + if (isalpha (path[0]) && path[1] == ':') + bs += 2; + else if (strspn (path, "/\\") > 1) + ++bs; + c = strrchr (bs, '/'); + if ((d = strrchr (c ?: bs, '\\')) > c) + c = d; + if (c) + return c + 1; + else if (!bs[0]) + return strcpy (buf, ""); + return (char *)path; +} + /* No need to be reentrant or thread-safe according to SUSv3. / and \\ are treated equally. Leading drive specifiers and leading double (back)slashes are kept intact as far as it diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index 814e65156..4f923b6e2 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-03-30 Yaakov Selkowitz + + * posix.xml (std-gnu): Add basename. + (std-notes): Add note about two forms of basename. + 2015-03-13 Jon TURNEY * Makefile.in (prefix): Define. diff --git a/winsup/doc/posix.xml b/winsup/doc/posix.xml index 5df808b58..95bc4008c 100644 --- a/winsup/doc/posix.xml +++ b/winsup/doc/posix.xml @@ -50,7 +50,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008). atoi atol atoll - basename + basename (see chapter "Implementation Notes") bind bsearch btowc @@ -1139,6 +1139,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008). asnprintf asprintf asprintf_r + basename (see chapter "Implementation Notes") canonicalize_file_name dremf dup3 @@ -1603,6 +1604,9 @@ group quotas, no inode quotas, no time constraints. qsort_r is available in both BSD and GNU flavors, depending on whether _BSD_SOURCE or _GNU_SOURCE is defined when compiling. +basename is available in both POSIX and GNU flavors, +depending on whether libgen.h is included or not. + From 84304a44b1b24404d7faa714dc9d9d7accd464be Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 25 Mar 2015 16:26:07 -0500 Subject: [PATCH 017/109] strftime: use tzname if TM_ZONE is NULL This avoids a strlen(NULL) crash a few lines later. * libc/time/strftime.c (strftime) <%Z>: Initialize tznam to NULL. Use _tzname as fallback if TM_ZONE is NULL. --- newlib/ChangeLog | 5 +++++ newlib/libc/time/strftime.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 7c57c94cd..6e45e940b 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2015-03-30 Yaakov Selkowitz + + * libc/time/strftime.c (strftime) <%Z>: Initialize tznam to NULL. + Use _tzname as fallback if TM_ZONE is NULL. + 2015-03-30 Yaakov Selkowitz * libc/include/libgen.h (_BASENAME_DEFINED): Define. diff --git a/newlib/libc/time/strftime.c b/newlib/libc/time/strftime.c index 7db338364..ee604c2e4 100644 --- a/newlib/libc/time/strftime.c +++ b/newlib/libc/time/strftime.c @@ -1311,7 +1311,7 @@ recurse: if (tim_p->tm_isdst >= 0) { size_t size; - const char *tznam; + const char *tznam = NULL; TZ_LOCK; #if defined (__CYGWIN__) @@ -1320,9 +1320,9 @@ recurse: tznam = __cygwin_gettzname (tim_p); #elif defined (__TM_ZONE) tznam = tim_p->__TM_ZONE; -#else - tznam = _tzname[tim_p->tm_isdst > 0]; #endif + if (!tznam) + tznam = _tzname[tim_p->tm_isdst > 0]; /* Note that in case of wcsftime this loop only works for timezone abbreviations using the portable codeset (aka ASCII). This seems to be the case, but if that ever changes, this From 792ecd7c34cb5e6b00099a2597c36e850b3a4d40 Mon Sep 17 00:00:00 2001 From: Craig Howland Date: Tue, 31 Mar 2015 10:26:49 +0200 Subject: [PATCH 018/109] Move tzset calls to time functions. * libc/stdlib/setenv_r.c (_setenv_r): Remove tzset() call for TZ definition. * libc/time/lcltime_r.c (localtime_r): Add tzset() call * libc/time/mktime.c (mktime): Ditto. * libc/time/strftime.c (strftime, wcsftime): Ditto. Signed-off-by: Corinna Vinschen --- newlib/ChangeLog | 8 ++++++++ newlib/libc/stdlib/setenv_r.c | 7 ------- newlib/libc/time/lcltime_r.c | 1 + newlib/libc/time/mktime.c | 2 ++ newlib/libc/time/strftime.c | 2 ++ 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 6e45e940b..c214b6988 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,11 @@ +2015-03-30 Craig Howland + + * libc/stdlib/setenv_r.c (_setenv_r): Remove tzset() call for TZ + definition. + * libc/time/lcltime_r.c (localtime_r): Add tzset() call + * libc/time/mktime.c (mktime): Ditto. + * libc/time/strftime.c (strftime, wcsftime): Ditto. + 2015-03-30 Yaakov Selkowitz * libc/time/strftime.c (strftime) <%Z>: Initialize tznam to NULL. diff --git a/newlib/libc/stdlib/setenv_r.c b/newlib/libc/stdlib/setenv_r.c index f9ff2c1cd..c32c6aca9 100644 --- a/newlib/libc/stdlib/setenv_r.c +++ b/newlib/libc/stdlib/setenv_r.c @@ -79,9 +79,6 @@ _DEFUN (_setenv_r, (reent_ptr, name, value, rewrite), { /* old larger; copy over */ while ((*C++ = *value++) != 0); ENV_UNLOCK; - /* if we are changing the TZ environment variable, update timezone info */ - if (strcmp (name, "TZ") == 0) - tzset (); return 0; } } @@ -128,10 +125,6 @@ _DEFUN (_setenv_r, (reent_ptr, name, value, rewrite), ENV_UNLOCK; - /* if we are setting the TZ environment variable, update timezone info */ - if (strncmp ((*p_environ)[offset], "TZ=", 3) == 0) - tzset (); - return 0; } diff --git a/newlib/libc/time/lcltime_r.c b/newlib/libc/time/lcltime_r.c index 9094e5d3a..8a69e40ee 100644 --- a/newlib/libc/time/lcltime_r.c +++ b/newlib/libc/time/lcltime_r.c @@ -31,6 +31,7 @@ _DEFUN (localtime_r, (tim_p, res), year = res->tm_year + YEAR_BASE; ip = __month_lengths[isleap(year)]; + tzset (); TZ_LOCK; if (_daylight) { diff --git a/newlib/libc/time/mktime.c b/newlib/libc/time/mktime.c index 5bedf5afc..8669fbdfb 100644 --- a/newlib/libc/time/mktime.c +++ b/newlib/libc/time/mktime.c @@ -197,6 +197,8 @@ _DEFUN(mktime, (tim_p), /* compute total seconds */ tim += (days * _SEC_IN_DAY); + tzset (); + TZ_LOCK; if (_daylight) diff --git a/newlib/libc/time/strftime.c b/newlib/libc/time/strftime.c index ee604c2e4..72f06d32e 100644 --- a/newlib/libc/time/strftime.c +++ b/newlib/libc/time/strftime.c @@ -1283,6 +1283,7 @@ recurse: if (tim_p->tm_isdst >= 0) { long offset; + tzset (); #if defined (__CYGWIN__) /* Cygwin must check if the application has been built with or @@ -1313,6 +1314,7 @@ recurse: size_t size; const char *tznam = NULL; + tzset (); TZ_LOCK; #if defined (__CYGWIN__) /* See above. */ From 5f4e1e895cf92b25ff59de19215ce41eca5b15a0 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 31 Mar 2015 11:14:22 +0200 Subject: [PATCH 019/109] Add _tzset_unlocked and _tzset_unlocked_r newlib: * libc/time/local.h (_tzset_unlocked_r): Add prototype. (_tzset_unlocked): Ditto. * libc/time/tzset.c (_tzset_unlocked): New function, call _tzset_unlocked_r. (tzset): Lock and call _tzset_unlocked_r. * libc/time/tzset_r (_tzset_unlocked_r): Remove locking and rename from _tzset_r. (_tzset_r): Lock and call _tzset_unlocked_r. cygwin: * localtime.cc (tzset_unlocked): Export as _tzset_unlocked. Signed-off-by: Corinna Vinschen --- newlib/ChangeLog | 11 +++++++++++ newlib/libc/time/local.h | 3 +++ newlib/libc/time/tzset.c | 10 +++++++++- newlib/libc/time/tzset_r.c | 34 ++++++++++++---------------------- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/localtime.cc | 10 ++++++++++ 6 files changed, 49 insertions(+), 23 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index c214b6988..420354ef6 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,14 @@ +2015-03-31 Corinna Vinschen + + * libc/time/local.h (_tzset_unlocked_r): Add prototype. + (_tzset_unlocked): Ditto. + * libc/time/tzset.c (_tzset_unlocked): New function, call + _tzset_unlocked_r. + (tzset): Lock and call _tzset_unlocked_r. + * libc/time/tzset_r (_tzset_unlocked_r): Remove locking and rename + from _tzset_r. + (_tzset_r): Lock and call _tzset_unlocked_r. + 2015-03-30 Craig Howland * libc/stdlib/setenv_r.c (_setenv_r): Remove tzset() call for TZ diff --git a/newlib/libc/time/local.h b/newlib/libc/time/local.h index 5fc3ddcb1..af5793af9 100644 --- a/newlib/libc/time/local.h +++ b/newlib/libc/time/local.h @@ -23,6 +23,9 @@ int _EXFUN (__tzcalc_limits, (int __year)); extern _CONST int __month_lengths[2][MONSPERYEAR]; +_VOID _EXFUN(_tzset_unlocked_r, (struct _reent *)); +_VOID _EXFUN(_tzset_unlocked, (_VOID)); + /* locks for multi-threading */ #ifdef __SINGLE_THREAD__ #define TZ_LOCK diff --git a/newlib/libc/time/tzset.c b/newlib/libc/time/tzset.c index d847a26b0..5c421a58e 100644 --- a/newlib/libc/time/tzset.c +++ b/newlib/libc/time/tzset.c @@ -67,8 +67,16 @@ Supporting OS subroutine required: None #include #include "local.h" +_VOID +_DEFUN_VOID (_tzset_unlocked) +{ + _tzset_unlocked_r (_REENT); +} + _VOID _DEFUN_VOID (tzset) { - _tzset_r (_REENT); + TZ_LOCK; + _tzset_unlocked_r (_REENT); + TZ_UNLOCK; } diff --git a/newlib/libc/time/tzset_r.c b/newlib/libc/time/tzset_r.c index 2c5b72341..6c21e822e 100644 --- a/newlib/libc/time/tzset_r.c +++ b/newlib/libc/time/tzset_r.c @@ -14,7 +14,7 @@ static char __tzname_dst[11]; static char *prev_tzenv = NULL; _VOID -_DEFUN (_tzset_r, (reent_ptr), +_DEFUN (_tzset_unlocked_r, (reent_ptr), struct _reent *reent_ptr) { char *tzenv; @@ -25,24 +25,17 @@ _DEFUN (_tzset_r, (reent_ptr), if ((tzenv = _getenv_r (reent_ptr, "TZ")) == NULL) { - TZ_LOCK; _timezone = 0; _daylight = 0; _tzname[0] = "GMT"; _tzname[1] = "GMT"; free(prev_tzenv); prev_tzenv = NULL; - TZ_UNLOCK; return; } - TZ_LOCK; - if (prev_tzenv != NULL && strcmp(tzenv, prev_tzenv) == 0) - { - TZ_UNLOCK; - return; - } + return; free(prev_tzenv); prev_tzenv = _malloc_r (reent_ptr, strlen(tzenv) + 1); @@ -54,10 +47,7 @@ _DEFUN (_tzset_r, (reent_ptr), ++tzenv; if (sscanf (tzenv, "%10[^0-9,+-]%n", __tzname_std, &n) <= 0) - { - TZ_UNLOCK; - return; - } + return; tzenv += n; @@ -74,10 +64,7 @@ _DEFUN (_tzset_r, (reent_ptr), ss = 0; if (sscanf (tzenv, "%hu%n:%hu%n:%hu%n", &hh, &n, &mm, &n, &ss, &n) < 1) - { - TZ_UNLOCK; - return; - } + return; tz->__tzrule[0].offset = sign * (ss + SECSPERMIN * mm + SECSPERHOUR * hh); _tzname[0] = __tzname_std; @@ -88,7 +75,6 @@ _DEFUN (_tzset_r, (reent_ptr), _tzname[1] = _tzname[0]; _timezone = tz->__tzrule[0].offset; _daylight = 0; - TZ_UNLOCK; return; } else @@ -127,10 +113,7 @@ _DEFUN (_tzset_r, (reent_ptr), { if (sscanf (tzenv, "M%hu%n.%hu%n.%hu%n", &m, &n, &w, &n, &d, &n) != 3 || m < 1 || m > 12 || w < 1 || w > 5 || d > 6) - { - TZ_UNLOCK; - return; - } + return; tz->__tzrule[i].ch = 'M'; tz->__tzrule[i].m = m; @@ -198,6 +181,13 @@ _DEFUN (_tzset_r, (reent_ptr), __tzcalc_limits (tz->__tzyear); _timezone = tz->__tzrule[0].offset; _daylight = tz->__tzrule[0].offset != tz->__tzrule[1].offset; +} +_VOID +_DEFUN (_tzset_r, (reent_ptr), + struct _reent *reent_ptr) +{ + TZ_LOCK; + _tzset_unlocked_r (reent_ptr); TZ_UNLOCK; } diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f496ec73b..09749e0b8 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2015-03-31 Corinna Vinschen + + * localtime.cc (tzset_unlocked): Export as _tzset_unlocked. + 2015-03-30 Yaakov Selkowitz * common.din (__gnu_basename): Export. diff --git a/winsup/cygwin/localtime.cc b/winsup/cygwin/localtime.cc index ca58b65e1..d57a020b5 100644 --- a/winsup/cygwin/localtime.cc +++ b/winsup/cygwin/localtime.cc @@ -500,7 +500,11 @@ static int tzload(timezone_t sp, const char * name, int doextend); static int tzparse(timezone_t sp, const char * name, int lastditch); +#ifdef __CYGWIN__ +extern "C" void tzset_unlocked(void); +#else static void tzset_unlocked(void); +#endif static long leapcorr(const timezone_t sp, time_t * timep); static timezone_t lclptr; @@ -1613,6 +1617,9 @@ tzsetwall (void) static NO_COPY muto tzset_guard; +#ifdef __CYGWIN__ +extern "C" +#else #ifndef STD_INSPIRED /* ** A non-static declaration of tzsetwall in a system header file @@ -1620,6 +1627,7 @@ static NO_COPY muto tzset_guard; */ static #endif /* !defined STD_INSPIRED */ +#endif void tzset_unlocked(void) { @@ -1663,6 +1671,8 @@ tzset_unlocked(void) settzname(); } +EXPORT_ALIAS (tzset_unlocked, _tzset_unlocked) + extern "C" void tzset(void) { From 70399a721cced0c702f6cfe8a08fb9dae45aa18f Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 31 Mar 2015 11:22:50 +0200 Subject: [PATCH 020/109] Avoid excessive locking and calling tzset in time functions. * libc/time/lcltime_r.c (localtime_r): Call _tzset_unlocked inside TZ lock. * libc/time/mktime.c (mktime): Ditto. * libc/time/strftime.c (strftime, wcsftime): Ditto. Guard against calling _tzset_unlocked more than once (baring recursion). Signed-off-by: Corinna Vinschen --- newlib/ChangeLog | 8 ++++++++ newlib/libc/time/lcltime_r.c | 2 +- newlib/libc/time/mktime.c | 4 ++-- newlib/libc/time/strftime.c | 16 ++++++++++++++-- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 420354ef6..e615421d1 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,11 @@ +2015-03-31 Corinna Vinschen + + * libc/time/lcltime_r.c (localtime_r): Call _tzset_unlocked inside + TZ lock. + * libc/time/mktime.c (mktime): Ditto. + * libc/time/strftime.c (strftime, wcsftime): Ditto. Guard against + calling _tzset_unlocked more than once (baring recursion). + 2015-03-31 Corinna Vinschen * libc/time/local.h (_tzset_unlocked_r): Add prototype. diff --git a/newlib/libc/time/lcltime_r.c b/newlib/libc/time/lcltime_r.c index 8a69e40ee..3342e9906 100644 --- a/newlib/libc/time/lcltime_r.c +++ b/newlib/libc/time/lcltime_r.c @@ -31,8 +31,8 @@ _DEFUN (localtime_r, (tim_p, res), year = res->tm_year + YEAR_BASE; ip = __month_lengths[isleap(year)]; - tzset (); TZ_LOCK; + _tzset_unlocked (); if (_daylight) { if (year == tz->__tzyear || __tzcalc_limits (year)) diff --git a/newlib/libc/time/mktime.c b/newlib/libc/time/mktime.c index 8669fbdfb..44c0257f7 100644 --- a/newlib/libc/time/mktime.c +++ b/newlib/libc/time/mktime.c @@ -197,10 +197,10 @@ _DEFUN(mktime, (tim_p), /* compute total seconds */ tim += (days * _SEC_IN_DAY); - tzset (); - TZ_LOCK; + _tzset_unlocked (); + if (_daylight) { int tm_isdst; diff --git a/newlib/libc/time/strftime.c b/newlib/libc/time/strftime.c index 72f06d32e..9e677346e 100644 --- a/newlib/libc/time/strftime.c +++ b/newlib/libc/time/strftime.c @@ -703,6 +703,7 @@ _DEFUN (strftime, (s, maxsize, format, tim_p), CHAR alt; CHAR pad; unsigned long width; + int tzset_called = 0; struct lc_time_T *_CurrentTimeLocale = __get_current_time_locale (); for (;;) @@ -1283,7 +1284,13 @@ recurse: if (tim_p->tm_isdst >= 0) { long offset; - tzset (); + + TZ_LOCK; + if (!tzset_called) + { + _tzset_unlocked (); + tzset_called = 1; + } #if defined (__CYGWIN__) /* Cygwin must check if the application has been built with or @@ -1302,6 +1309,7 @@ recurse: but have to use __tzrule for daylight savings. */ offset = -tz->__tzrule[tim_p->tm_isdst > 0].offset; #endif + TZ_UNLOCK; len = snprintf (&s[count], maxsize - count, CQ("%+03ld%.2ld"), offset / SECSPERHOUR, labs (offset / SECSPERMIN) % 60L); @@ -1314,8 +1322,12 @@ recurse: size_t size; const char *tznam = NULL; - tzset (); TZ_LOCK; + if (!tzset_called) + { + _tzset_unlocked (); + tzset_called = 1; + } #if defined (__CYGWIN__) /* See above. */ extern const char *__cygwin_gettzname (const struct tm *tmp); From 1c7ac6e19028bc93f237557e781f1bf98ee29ea5 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 31 Mar 2015 11:54:34 +0200 Subject: [PATCH 021/109] Don't allow fully qualified Windows account names. * uinfo.cc (pwdgrp::fetch_account_from_windows): Don't allow fully qualified Windows account names (domain\user or user@domain). Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/uinfo.cc | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 09749e0b8..0e23b0391 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-03-31 Corinna Vinschen + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Don't allow fully + qualified Windows account names (domain\user or user@domain). + 2015-03-31 Corinna Vinschen * localtime.cc (tzset_unlocked): Export as _tzset_unlocked. diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index f78e484dd..6186327b6 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -1827,6 +1827,13 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap) fq_name = false; /* Copy over to wchar for search. */ sys_mbstowcs (name, UNLEN + 1, arg.name); + /* If the incoming name has a backslash or at sign, and neither backslash + nor at are the domain separator chars, the name is invalid. */ + if ((p = wcspbrk (name, L"\\@")) && *p != cygheap->pg.nss_separator ()[0]) + { + debug_printf ("Invalid account name <%s> (backslash/at)", arg.name); + return NULL; + } /* Replace domain separator char with backslash and make sure p is NULL or points to the backslash. */ if ((p = wcschr (name, cygheap->pg.nss_separator ()[0]))) From 87dd9bec10b09457ff2667bea29b6677f37d1f0c Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 31 Mar 2015 13:12:24 +0200 Subject: [PATCH 022/109] Document GNU basename. * new-features.xml (ov-new1.7.36): Add new section. Document GNU basename. Signed-off-by: Corinna Vinschen --- winsup/doc/ChangeLog | 5 +++++ winsup/doc/new-features.xml | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index 4f923b6e2..b90e6c194 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-03-31 Corinna Vinschen + + * new-features.xml (ov-new1.7.36): Add new section. Document GNU + basename. + 2015-03-30 Yaakov Selkowitz * posix.xml (std-gnu): Add basename. diff --git a/winsup/doc/new-features.xml b/winsup/doc/new-features.xml index fbbbdad28..3f8b967a7 100644 --- a/winsup/doc/new-features.xml +++ b/winsup/doc/new-features.xml @@ -4,6 +4,24 @@ What's new and what changed in Cygwin +What's new and what changed in 1.7.36 + + + + +basename(3) now comes in two flavors, POSIX and GNU. The POSIX version is +the default. You get the GNU version after + + + #define _GNU_SOURCE + #include <string.h> + + + + + + + What's new and what changed in 1.7.35 From 46d2802c2792cdc250f992c031dcb43cd8cd1252 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 31 Mar 2015 13:13:06 +0200 Subject: [PATCH 023/109] Add release msg Signed-off-by: Corinna Vinschen --- winsup/cygwin/release/1.7.36 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/winsup/cygwin/release/1.7.36 b/winsup/cygwin/release/1.7.36 index e9cfc6154..39855783c 100644 --- a/winsup/cygwin/release/1.7.36 +++ b/winsup/cygwin/release/1.7.36 @@ -1,6 +1,12 @@ What's new: ----------- +- basename(3) now comes in two flavors, POSIX and GNU. The POSIX version is + the default. You get the GNU version after + + #define _GNU_SOURCE + #include + What changed: ------------- @@ -22,3 +28,7 @@ Bug Fixes - Fix internal error in pty -ONLCR handling. Fix timing bug in pty OPOST handling. Addresses: https://cygwin.com/ml/cygwin/2015-02/msg00929.html + +- Avoid creating passwd and group records from fully qualified Windows + account names (domain\name, name@domain). + Addresses: https://cygwin.com/ml/cygwin/2015-03/msg00528.html From 2cf6edf4eff7231fad4c548e27ad814faeafe894 Mon Sep 17 00:00:00 2001 From: Renato Silva Date: Tue, 31 Mar 2015 21:18:46 +0200 Subject: [PATCH 024/109] Fix buffer size error handling in gethostname. * net.cc (cygwin_gethostname): Fix buffer size error handling. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/net.cc | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0e23b0391..0d07bb1f7 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2015-03-31 Renato Silva + + * net.cc (cygwin_gethostname): Fix buffer size error handling. + 2015-03-31 Corinna Vinschen * uinfo.cc (pwdgrp::fetch_account_from_windows): Don't allow fully diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index f9b317c0d..eaf6eb870 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -1076,7 +1076,10 @@ cygwin_gethostname (char *name, size_t len) if (!GetComputerNameExA (ComputerNameDnsFullyQualified, name, &local_len)) { - set_winsock_errno (); + if (GetLastError () == ERROR_MORE_DATA) + set_errno (ENAMETOOLONG); + else + set_winsock_errno (); __leave; } } From 69d477a25cbff04c0ed0261aecc53290f2a4ff61 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Tue, 31 Mar 2015 18:32:41 +0100 Subject: [PATCH 025/109] Fix documentation of cygwin_internal()'s return type. * misc-funcs.xml (cygwin_internal): Correct return type. Signed-off-by: Jon TURNEY --- winsup/doc/ChangeLog | 4 ++++ winsup/doc/misc-funcs.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index b90e6c194..30d9fdc6f 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-03-31 Jon TURNEY + + * misc-funcs.xml (cygwin_internal): Correct return type. + 2015-03-31 Corinna Vinschen * new-features.xml (ov-new1.7.36): Add new section. Document GNU diff --git a/winsup/doc/misc-funcs.xml b/winsup/doc/misc-funcs.xml index 06776d9e7..b16434152 100644 --- a/winsup/doc/misc-funcs.xml +++ b/winsup/doc/misc-funcs.xml @@ -34,7 +34,7 @@ much. cygwin_internal -extern "C" DWORD +extern "C" uintptr_t cygwin_internal cygwin_getinfo_types t ... From 849044a1e92553789fab9843fbdca507bf6c14d7 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 1 Apr 2015 13:15:18 +0200 Subject: [PATCH 026/109] Avoid potential crash at startup or in getgroups(2). * grp.cc (internal_getgroups): Handle negative domain index to avoid crashes. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/grp.cc | 6 +++++- winsup/cygwin/release/1.7.36 | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0d07bb1f7..69a494d51 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-01 Corinna Vinschen + + * grp.cc (internal_getgroups): Handle negative domain index to avoid + crashes. + 2015-03-31 Renato Silva * net.cc (cygwin_gethostname): Fix buffer size error handling. diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc index ea20e926c..40e1ca763 100644 --- a/winsup/cygwin/grp.cc +++ b/winsup/cygwin/grp.cc @@ -643,13 +643,17 @@ internal_getgroups (int gidsetsize, gid_t *grouplist, cyg_ldap *pldap) { for (ULONG ncnt = 0; ncnt < scnt; ++ncnt) { + static UNICODE_STRING empty = { 0, 0, (PWSTR) L"" }; fetch_acc_t full_acc = { .sid = sidp_buf[ncnt], .name = &nlst[ncnt].Name, - .dom = &dlst->Domains[nlst[ncnt].DomainIndex].Name, + .dom = &empty, .acc_type = nlst[ncnt].Use }; + + if (nlst[ncnt].DomainIndex >= 0) + full_acc.dom = &dlst->Domains[nlst[ncnt].DomainIndex].Name; if ((grp = internal_getgrfull (full_acc, pldap))) { if (cnt < gidsetsize) diff --git a/winsup/cygwin/release/1.7.36 b/winsup/cygwin/release/1.7.36 index 39855783c..21175c9ac 100644 --- a/winsup/cygwin/release/1.7.36 +++ b/winsup/cygwin/release/1.7.36 @@ -32,3 +32,6 @@ Bug Fixes - Avoid creating passwd and group records from fully qualified Windows account names (domain\name, name@domain). Addresses: https://cygwin.com/ml/cygwin/2015-03/msg00528.html + +- Avoid potential crash at startup or in getgroups(2). + Addresses: https://cygwin.com/ml/cygwin/2015-04/msg00010.html From 829c8f6c2dc1b849f5037ce7b27f4b7b00b257e9 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 1 Apr 2015 15:31:18 +0200 Subject: [PATCH 027/109] Fix UTF-16 surrogate handling in wctomb and friends. * libc/stdlib/wctomb_r.c (__utf8_wctomb): Fix check for handling a lone high surrogate. Signed-off-by: Corinna Vinschen --- newlib/ChangeLog | 5 +++++ newlib/libc/stdlib/wctomb_r.c | 2 +- winsup/cygwin/release/1.7.36 | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index e615421d1..a5a31c7b0 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2015-04-01 Corinna Vinschen + + * libc/stdlib/wctomb_r.c (__utf8_wctomb): Fix check for handling a + lone high surrogate. + 2015-03-31 Corinna Vinschen * libc/time/lcltime_r.c (localtime_r): Call _tzset_unlocked inside diff --git a/newlib/libc/stdlib/wctomb_r.c b/newlib/libc/stdlib/wctomb_r.c index 13e1e4c36..c93962fa4 100644 --- a/newlib/libc/stdlib/wctomb_r.c +++ b/newlib/libc/stdlib/wctomb_r.c @@ -74,7 +74,7 @@ _DEFUN (__utf8_wctomb, (r, s, wchar, charset, state), return 0; /* UTF-8 encoding is not state-dependent */ if (sizeof (wchar_t) == 2 && state->__count == -4 - && (wchar < 0xdc00 || wchar >= 0xdfff)) + && (wchar < 0xdc00 || wchar > 0xdfff)) { /* There's a leftover lone high surrogate. Write out the CESU-8 value of the surrogate and proceed to convert the given character. Note diff --git a/winsup/cygwin/release/1.7.36 b/winsup/cygwin/release/1.7.36 index 21175c9ac..0515ef96e 100644 --- a/winsup/cygwin/release/1.7.36 +++ b/winsup/cygwin/release/1.7.36 @@ -35,3 +35,6 @@ Bug Fixes - Avoid potential crash at startup or in getgroups(2). Addresses: https://cygwin.com/ml/cygwin/2015-04/msg00010.html + +- Fix UTF-16 surrogate handling in wctomb and friends. + Addresses: https://cygwin.com/ml/cygwin/2015-03/msg00452.html From abf6791ecb3e4b7ed68bce33d0c81b8505cfd2c8 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 30 Mar 2015 18:05:51 +0100 Subject: [PATCH 028/109] Rename struct ucontext to struct __mcontext * include/cygwin/signal.h : Rename struct ucontext to struct __mcontext. Fix layout differences from the Win32 API CONTEXT type. Remove unused member _internal. Rename member which corresponds to ContextFlags. Add cr2 member. Signed-off-by: Jon TURNEY --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/include/cygwin/signal.h | 28 ++++++++++++++++++--------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 69a494d51..d283af690 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2015-04-01 Jon TURNEY + + * include/cygwin/signal.h : Rename struct ucontext to struct + __mcontext. Fix layout differences from the Win32 API CONTEXT + type. Remove unused member _internal. Rename member which + corresponds to ContextFlags. Add cr2 member. + 2015-04-01 Corinna Vinschen * grp.cc (internal_getgroups): Handle negative domain index to avoid diff --git a/winsup/cygwin/include/cygwin/signal.h b/winsup/cygwin/include/cygwin/signal.h index 58bbff059..04e65aa34 100644 --- a/winsup/cygwin/include/cygwin/signal.h +++ b/winsup/cygwin/include/cygwin/signal.h @@ -18,6 +18,10 @@ extern "C" { #endif +/* + Define a struct __mcontext, which should be identical in layout to the Win32 + API type CONTEXT with the addition of oldmask and cr2 fields at the end. +*/ #ifdef __x86_64__ struct _uc_fpxreg { @@ -45,7 +49,7 @@ struct _fpstate __uint32_t padding[24]; }; -struct ucontext +struct __mcontext { __uint64_t p1home; __uint64_t p2home; @@ -53,7 +57,7 @@ struct ucontext __uint64_t p4home; __uint64_t p5home; __uint64_t p6home; - __uint32_t cr2; + __uint32_t ctxflags; __uint32_t mxcsr; __uint16_t cs; __uint16_t ds; @@ -86,14 +90,15 @@ struct ucontext __uint64_t r15; __uint64_t rip; struct _fpstate fpregs; + __uint64_t vregs[52]; __uint64_t vcx; __uint64_t dbc; __uint64_t btr; __uint64_t bfr; __uint64_t etr; __uint64_t efr; - __uint8_t _internal; __uint64_t oldmask; + __uint64_t cr2; }; #else /* !x86_64 */ @@ -117,9 +122,9 @@ struct _fpstate __uint32_t nxst; }; -struct ucontext +struct __mcontext { - __uint32_t cr2; + __uint32_t ctxflags; __uint32_t dr0; __uint32_t dr1; __uint32_t dr2; @@ -143,15 +148,20 @@ struct ucontext __uint32_t eflags; __uint32_t esp; __uint32_t ss; - __uint8_t _internal; + __uint32_t reserved[128]; __uint32_t oldmask; + __uint32_t cr2; }; #endif /* !x86_64 */ -/* Needed for GDB. It only compiles in the context copy code if this - macro s defined. */ -#define __COPY_CONTEXT_SIZE ((size_t) (uintptr_t) &((struct ucontext *) 0)->_internal) +/* Needed for GDB. It only compiles in the context copy code if this macro is + defined. This is not sizeof(CONTEXT) due to historical accidents. */ +#ifdef __x86_64__ +#define __COPY_CONTEXT_SIZE 816 +#else +#define __COPY_CONTEXT_SIZE 204 +#endif typedef union sigval { From 431b28c19663232eefd4aeb54b7480040e57bb2a Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 30 Mar 2015 20:56:03 +0100 Subject: [PATCH 029/109] Add cygwin_internal() operation to retrieve the EXCEPTION_RECORD from a siginfo_t * * external.cc (cygwin_internal): Add operation to retrieve a copy of the EXCEPTION_RECORD from a siginfo_t *. * include/sys/cygwin.h (cygwin_getinfo_types): Ditto. * exception.h (cygwin_exception): Add exception_record accessor. Signed-off-by: Jon TURNEY --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/exception.h | 1 + winsup/cygwin/external.cc | 14 ++++++++++++++ winsup/cygwin/include/sys/cygwin.h | 5 ++++- 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d283af690..3aa43af9e 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2015-04-01 Jon TURNEY + + * external.cc (cygwin_internal): Add operation to retrieve a copy + of the EXCEPTION_RECORD from a siginfo_t *. + * include/sys/cygwin.h (cygwin_getinfo_types): Ditto. + * exception.h (cygwin_exception): Add exception_record accessor. + 2015-04-01 Jon TURNEY * include/cygwin/signal.h : Rename struct ucontext to struct diff --git a/winsup/cygwin/exception.h b/winsup/cygwin/exception.h index 3686bb0b2..0478daf79 100644 --- a/winsup/cygwin/exception.h +++ b/winsup/cygwin/exception.h @@ -175,4 +175,5 @@ public: framep (in_framep), ctx (in_ctx), e (in_e), h (NULL) {} void dumpstack (); PCONTEXT context () const {return ctx;} + EXCEPTION_RECORD *exception_record () const {return e;} }; diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index 5fac4bb66..e379df1d2 100644 --- a/winsup/cygwin/external.cc +++ b/winsup/cygwin/external.cc @@ -27,6 +27,7 @@ details. */ #include "environ.h" #include "cygserver_setpwd.h" #include "pwdgrp.h" +#include "exception.h" #include #include #include @@ -688,6 +689,19 @@ cygwin_internal (cygwin_getinfo_types t, ...) res = 0; break; + case CW_EXCEPTION_RECORD_FROM_SIGINFO_T: + { + siginfo_t *si = va_arg(arg, siginfo_t *); + EXCEPTION_RECORD *er = va_arg(arg, EXCEPTION_RECORD *); + if (si && si->si_cyg && er) + { + memcpy(er, ((cygwin_exception *)si->si_cyg)->exception_record(), + sizeof(EXCEPTION_RECORD)); + res = 0; + } + } + break; + default: set_errno (ENOSYS); } diff --git a/winsup/cygwin/include/sys/cygwin.h b/winsup/cygwin/include/sys/cygwin.h index edfcc565a..2ec6086b0 100644 --- a/winsup/cygwin/include/sys/cygwin.h +++ b/winsup/cygwin/include/sys/cygwin.h @@ -1,3 +1,4 @@ + /* sys/cygwin.h Copyright 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, @@ -153,7 +154,8 @@ typedef enum CW_CYGNAME_FROM_WINNAME, CW_FIXED_ATEXIT, CW_GETNSS_PWD_SRC, - CW_GETNSS_GRP_SRC + CW_GETNSS_GRP_SRC, + CW_EXCEPTION_RECORD_FROM_SIGINFO_T, } cygwin_getinfo_types; #define CW_LOCK_PINFO CW_LOCK_PINFO @@ -214,6 +216,7 @@ typedef enum #define CW_FIXED_ATEXIT CW_FIXED_ATEXIT #define CW_GETNSS_PWD_SRC CW_GETNSS_PWD_SRC #define CW_GETNSS_GRP_SRC CW_GETNSS_GRP_SRC +#define CW_EXCEPTION_RECORD_FROM_SIGINFO_T CW_EXCEPTION_RECORD_FROM_SIGINFO_T /* Token type for CW_SET_EXTERNAL_TOKEN */ enum From f992ae6f4da99b6a200cfc146b96e8e921ca1e70 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 1 Apr 2015 00:12:07 +0100 Subject: [PATCH 030/109] Make stack_t typedef generally available * libc/include/sys/signal.h (stack_t): Make typedef generally available. Signed-off-by: Jon TURNEY --- newlib/ChangeLog | 5 +++++ newlib/libc/include/sys/signal.h | 18 +++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index a5a31c7b0..d6d194af0 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2015-04-01 Jon TURNEY + + * libc/include/sys/signal.h (stack_t): Make typedef generally + available. + 2015-04-01 Corinna Vinschen * libc/stdlib/wctomb_r.c (__utf8_wctomb): Fix check for handling a diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h index 7fc30a777..6ff758ce7 100644 --- a/newlib/libc/include/sys/signal.h +++ b/newlib/libc/include/sys/signal.h @@ -125,15 +125,6 @@ struct sigaction { */ #define SS_ONSTACK 0x1 #define SS_DISABLE 0x2 - -/* - * Structure used in sigaltstack call. - */ -typedef struct sigaltstack { - void *ss_sp; /* Stack base or pointer. */ - int ss_flags; /* Flags. */ - size_t ss_size; /* Stack size. */ -} stack_t; #endif #elif defined(__CYGWIN__) @@ -151,6 +142,15 @@ struct sigaction }; #endif /* defined(__rtems__) */ +/* + * Structure used in sigaltstack call. + */ +typedef struct sigaltstack { + void *ss_sp; /* Stack base or pointer. */ + int ss_flags; /* Flags. */ + size_t ss_size; /* Stack size. */ +} stack_t; + #define SIG_SETMASK 0 /* set mask with sigprocmask() */ #define SIG_BLOCK 1 /* set of signals to block */ #define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ From 28e457cd717d630d6ac13dba7b8f2a162156effb Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 30 Mar 2015 20:31:13 +0100 Subject: [PATCH 031/109] Provide ucontext to signal handlers Add ucontext.h header, defining ucontext_t and mcontext_t types. Provide sigaction sighandlers with a ucontext_t parameter, containing stack and context information. * include/sys/ucontext.h : New header. * include/ucontext.h : Ditto. * exceptions.cc (call_signal_handler): Provide ucontext_t parameter to signal handler function. Signed-off-by: Jon TURNEY --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/exceptions.cc | 23 +++++++++++++++++++++-- winsup/cygwin/include/sys/ucontext.h | 26 ++++++++++++++++++++++++++ winsup/cygwin/include/ucontext.h | 16 ++++++++++++++++ 4 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 winsup/cygwin/include/sys/ucontext.h create mode 100644 winsup/cygwin/include/ucontext.h diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3aa43af9e..4ed8b2f57 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2015-04-01 Jon TURNEY + + * include/sys/ucontext.h : New header. + * include/ucontext.h : Ditto. + * exceptions.cc (call_signal_handler): Provide ucontext_t + parameter to signal handler function. + 2015-04-01 Jon TURNEY * external.cc (cygwin_internal): Add operation to retrieve a copy diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index af534574b..0d1f36d50 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -16,6 +16,7 @@ details. */ #include #include #include +#include #include "cygtls.h" #include "pinfo.h" @@ -1489,15 +1490,33 @@ _cygtls::call_signal_handler () siginfo_t thissi = infodata; void (*thisfunc) (int, siginfo_t *, void *) = func; + ucontext_t thiscontext; + thiscontext.uc_link = 0; + thiscontext.uc_flags = 0; + if (thissi.si_cyg) + memcpy (&thiscontext.uc_mcontext, ((cygwin_exception *)thissi.si_cyg)->context(), sizeof(CONTEXT)); + else + RtlCaptureContext ((CONTEXT *)&thiscontext.uc_mcontext); + /* FIXME: Really this should be the context which the signal interrupted? */ + + /* FIXME: If/when sigaltstack is implemented, this will need to do + something more complicated */ + thiscontext.uc_stack.ss_sp = NtCurrentTeb ()->Tib.StackBase; + thiscontext.uc_stack.ss_flags = 0; + if (!NtCurrentTeb ()->DeallocationStack) + thiscontext.uc_stack.ss_size = (uintptr_t)NtCurrentTeb ()->Tib.StackLimit - (uintptr_t)NtCurrentTeb ()->Tib.StackBase; + else + thiscontext.uc_stack.ss_size = (uintptr_t)NtCurrentTeb ()->DeallocationStack - (uintptr_t)NtCurrentTeb ()->Tib.StackBase; + sigset_t this_oldmask = set_process_mask_delta (); + thiscontext.uc_sigmask = this_oldmask; int this_errno = saved_errno; reset_signal_arrived (); incyg = false; sig = 0; /* Flag that we can accept another signal */ unlock (); /* unlock signal stack */ - /* no ucontext_t information provided yet, so third arg is NULL */ - thisfunc (thissig, &thissi, NULL); + thisfunc (thissig, &thissi, &thiscontext); incyg = true; set_signal_mask (_my_tls.sigmask, this_oldmask); diff --git a/winsup/cygwin/include/sys/ucontext.h b/winsup/cygwin/include/sys/ucontext.h new file mode 100644 index 000000000..9362d90cd --- /dev/null +++ b/winsup/cygwin/include/sys/ucontext.h @@ -0,0 +1,26 @@ +/* ucontext.h + + Copyright 2015 Red Hat, Inc. + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#ifndef _SYS_UCONTEXT_H_ +#define _SYS_UCONTEXT_H_ + +#include + +typedef struct __mcontext mcontext_t; + +typedef struct __ucontext { + struct __ucontext *uc_link; + sigset_t uc_sigmask; + stack_t uc_stack; + mcontext_t uc_mcontext; + unsigned long int uc_flags; +} ucontext_t; + +#endif /* !_SYS_UCONTEXT_H_ */ diff --git a/winsup/cygwin/include/ucontext.h b/winsup/cygwin/include/ucontext.h new file mode 100644 index 000000000..4240597b8 --- /dev/null +++ b/winsup/cygwin/include/ucontext.h @@ -0,0 +1,16 @@ +/* ucontext.h + + Copyright 2015 Red Hat, Inc. + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#ifndef _UCONTEXT_H +#define _UCONTEXT_H + +#include + +#endif /* _UCONTEXT_H */ From b5748328304de7eaa2fb9245586144c22d95a324 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 1 Apr 2015 20:34:08 +0200 Subject: [PATCH 032/109] Add for FreeBSD compatibility * libc/include/sys/_stdint.h: New file. * libc/include/stdint.h (int8_t): Move to . (uint8_t): Likewise. (int16_t): Likewise. (uint16_t): Likewise. (int32_t): Likewise. (uint32_t): Likewise. (int64_t): Likewise. (uint64_t): Likewise. (intptr_t): Likewise. (uintptr_t): Likewise. * libc/include/sys/types.h: Include . * libc/sys/rtems/machine/_types.h: Remove include. * libc/sys/time.h>: Replace __uint32_t with uint32_t and __uint64_t with uint64_t. Signed-off-by: Corinna Vinschen --- newlib/ChangeLog | 18 ++++++++++ newlib/libc/include/stdint.h | 28 +-------------- newlib/libc/include/sys/_stdint.h | 49 ++++++++++++++++++++++++++ newlib/libc/include/sys/time.h | 36 +++++++++---------- newlib/libc/include/sys/types.h | 1 + newlib/libc/sys/rtems/machine/_types.h | 1 - 6 files changed, 87 insertions(+), 46 deletions(-) create mode 100644 newlib/libc/include/sys/_stdint.h diff --git a/newlib/ChangeLog b/newlib/ChangeLog index d6d194af0..1d43b0df2 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,21 @@ +2015-04-01 Sebastian Huber + + * libc/include/sys/_stdint.h: New file. + * libc/include/stdint.h (int8_t): Move to . + (uint8_t): Likewise. + (int16_t): Likewise. + (uint16_t): Likewise. + (int32_t): Likewise. + (uint32_t): Likewise. + (int64_t): Likewise. + (uint64_t): Likewise. + (intptr_t): Likewise. + (uintptr_t): Likewise. + * libc/include/sys/types.h: Include . + * libc/sys/rtems/machine/_types.h: Remove include. + * libc/sys/time.h>: Replace __uint32_t with uint32_t and + __uint64_t with uint64_t. + 2015-04-01 Jon TURNEY * libc/include/sys/signal.h (stack_t): Make typedef generally diff --git a/newlib/libc/include/stdint.h b/newlib/libc/include/stdint.h index 7386164b9..a2c9fea03 100644 --- a/newlib/libc/include/stdint.h +++ b/newlib/libc/include/stdint.h @@ -11,53 +11,30 @@ #include #include +#include #ifdef __cplusplus extern "C" { #endif -#ifdef ___int8_t_defined -typedef __int8_t int8_t ; -typedef __uint8_t uint8_t ; -#define __int8_t_defined 1 -#endif - #ifdef ___int_least8_t_defined typedef __int_least8_t int_least8_t; typedef __uint_least8_t uint_least8_t; #define __int_least8_t_defined 1 #endif -#ifdef ___int16_t_defined -typedef __int16_t int16_t ; -typedef __uint16_t uint16_t ; -#define __int16_t_defined 1 -#endif - #ifdef ___int_least16_t_defined typedef __int_least16_t int_least16_t; typedef __uint_least16_t uint_least16_t; #define __int_least16_t_defined 1 #endif -#ifdef ___int32_t_defined -typedef __int32_t int32_t ; -typedef __uint32_t uint32_t ; -#define __int32_t_defined 1 -#endif - #ifdef ___int_least32_t_defined typedef __int_least32_t int_least32_t; typedef __uint_least32_t uint_least32_t; #define __int_least32_t_defined 1 #endif -#ifdef ___int64_t_defined -typedef __int64_t int64_t ; -typedef __uint64_t uint64_t ; -#define __int64_t_defined 1 -#endif - #ifdef ___int_least64_t_defined typedef __int_least64_t int_least64_t; typedef __uint_least64_t uint_least64_t; @@ -166,9 +143,6 @@ typedef __uint_least64_t uint_least64_t; typedef unsigned long uintmax_t; #endif -typedef __intptr_t intptr_t; -typedef __uintptr_t uintptr_t; - #ifdef __INTPTR_TYPE__ #define INTPTR_MIN (-__INTPTR_MAX__ - 1) #define INTPTR_MAX __INTPTR_MAX__ diff --git a/newlib/libc/include/sys/_stdint.h b/newlib/libc/include/sys/_stdint.h new file mode 100644 index 000000000..add1860c5 --- /dev/null +++ b/newlib/libc/include/sys/_stdint.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2004, 2005 by + * Ralf Corsepius, Ulm/Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#ifndef _SYS__STDINT_H +#define _SYS__STDINT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef ___int8_t_defined +typedef __int8_t int8_t ; +typedef __uint8_t uint8_t ; +#define __int8_t_defined 1 +#endif + +#ifdef ___int16_t_defined +typedef __int16_t int16_t ; +typedef __uint16_t uint16_t ; +#define __int16_t_defined 1 +#endif + +#ifdef ___int32_t_defined +typedef __int32_t int32_t ; +typedef __uint32_t uint32_t ; +#define __int32_t_defined 1 +#endif + +#ifdef ___int64_t_defined +typedef __int64_t int64_t ; +typedef __uint64_t uint64_t ; +#define __int64_t_defined 1 +#endif + +typedef __intptr_t intptr_t; +typedef __uintptr_t uintptr_t; + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS__STDINT_H */ diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h index e65910467..ce8cad662 100644 --- a/newlib/libc/include/sys/time.h +++ b/newlib/libc/include/sys/time.h @@ -57,13 +57,13 @@ struct timezone { #if __BSD_VISIBLE struct bintime { time_t sec; - __uint64_t frac; + uint64_t frac; }; static __inline void -bintime_addx(struct bintime *_bt, __uint64_t _x) +bintime_addx(struct bintime *_bt, uint64_t _x) { - __uint64_t _u; + uint64_t _u; _u = _bt->frac; _bt->frac += _x; @@ -74,7 +74,7 @@ bintime_addx(struct bintime *_bt, __uint64_t _x) static __inline void bintime_add(struct bintime *_bt, const struct bintime *_bt2) { - __uint64_t _u; + uint64_t _u; _u = _bt->frac; _bt->frac += _bt2->frac; @@ -86,7 +86,7 @@ bintime_add(struct bintime *_bt, const struct bintime *_bt2) static __inline void bintime_sub(struct bintime *_bt, const struct bintime *_bt2) { - __uint64_t _u; + uint64_t _u; _u = _bt->frac; _bt->frac -= _bt2->frac; @@ -98,7 +98,7 @@ bintime_sub(struct bintime *_bt, const struct bintime *_bt2) static __inline void bintime_mul(struct bintime *_bt, u_int _x) { - __uint64_t _p1, _p2; + uint64_t _p1, _p2; _p1 = (_bt->frac & 0xffffffffull) * _x; _p2 = (_bt->frac >> 32) * _x + (_p1 >> 32); @@ -117,7 +117,7 @@ bintime_shift(struct bintime *_bt, int _exp) _bt->frac <<= _exp; } else if (_exp < 0) { _bt->frac >>= -_exp; - _bt->frac |= (__uint64_t)_bt->sec << (64 + _exp); + _bt->frac |= (uint64_t)_bt->sec << (64 + _exp); _bt->sec >>= -_exp; } } @@ -179,8 +179,8 @@ bintime2timespec(const struct bintime *_bt, struct timespec *_ts) { _ts->tv_sec = _bt->sec; - _ts->tv_nsec = ((__uint64_t)1000000000 * - (__uint32_t)(_bt->frac >> 32)) >> 32; + _ts->tv_nsec = ((uint64_t)1000000000 * + (uint32_t)(_bt->frac >> 32)) >> 32; } static __inline void @@ -189,7 +189,7 @@ timespec2bintime(const struct timespec *_ts, struct bintime *_bt) _bt->sec = _ts->tv_sec; /* 18446744073 = int(2^64 / 1000000000) */ - _bt->frac = _ts->tv_nsec * (__uint64_t)18446744073LL; + _bt->frac = _ts->tv_nsec * (uint64_t)18446744073LL; } static __inline void @@ -197,7 +197,7 @@ bintime2timeval(const struct bintime *_bt, struct timeval *_tv) { _tv->tv_sec = _bt->sec; - _tv->tv_usec = ((__uint64_t)1000000 * (__uint32_t)(_bt->frac >> 32)) >> 32; + _tv->tv_usec = ((uint64_t)1000000 * (uint32_t)(_bt->frac >> 32)) >> 32; } static __inline void @@ -206,7 +206,7 @@ timeval2bintime(const struct timeval *_tv, struct bintime *_bt) _bt->sec = _tv->tv_sec; /* 18446744073709 = int(2^64 / 1000000) */ - _bt->frac = _tv->tv_usec * (__uint64_t)18446744073709LL; + _bt->frac = _tv->tv_usec * (uint64_t)18446744073709LL; } static __inline struct timespec @@ -215,7 +215,7 @@ sbttots(sbintime_t _sbt) struct timespec _ts; _ts.tv_sec = _sbt >> 32; - _ts.tv_nsec = ((__uint64_t)1000000000 * (__uint32_t)_sbt) >> 32; + _ts.tv_nsec = ((uint64_t)1000000000 * (uint32_t)_sbt) >> 32; return (_ts); } @@ -224,7 +224,7 @@ tstosbt(struct timespec _ts) { return (((sbintime_t)_ts.tv_sec << 32) + - (_ts.tv_nsec * (((__uint64_t)1 << 63) / 500000000) >> 32)); + (_ts.tv_nsec * (((uint64_t)1 << 63) / 500000000) >> 32)); } static __inline struct timeval @@ -233,7 +233,7 @@ sbttotv(sbintime_t _sbt) struct timeval _tv; _tv.tv_sec = _sbt >> 32; - _tv.tv_usec = ((__uint64_t)1000000 * (__uint32_t)_sbt) >> 32; + _tv.tv_usec = ((uint64_t)1000000 * (uint32_t)_sbt) >> 32; return (_tv); } @@ -242,7 +242,7 @@ tvtosbt(struct timeval _tv) { return (((sbintime_t)_tv.tv_sec << 32) + - (_tv.tv_usec * (((__uint64_t)1 << 63) / 500000) >> 32)); + (_tv.tv_usec * (((uint64_t)1 << 63) / 500000) >> 32)); } #endif /* __BSD_VISIBLE */ @@ -390,7 +390,7 @@ int tvtohz(struct timeval *tv); #define TC_DEFAULTPERC 5 #define BT2FREQ(bt) \ - (((__uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) / \ + (((uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) / \ ((bt)->frac >> 1)) #define SBT2FREQ(sbt) ((SBT_1S + ((sbt) >> 1)) / (sbt)) @@ -398,7 +398,7 @@ int tvtohz(struct timeval *tv); #define FREQ2BT(freq, bt) \ { \ (bt)->sec = 0; \ - (bt)->frac = ((__uint64_t)0x8000000000000000 / (freq)) << 1; \ + (bt)->frac = ((uint64_t)0x8000000000000000 / (freq)) << 1; \ } #define TIMESEL(sbt, sbt2) \ diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index 227f83cf5..9fe2f5de1 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -59,6 +59,7 @@ typedef quad_t * qaddr_t; #define _SYS_TYPES_H #include +#include #ifdef __i386__ #if defined (GO32) || defined (__MSDOS__) diff --git a/newlib/libc/sys/rtems/machine/_types.h b/newlib/libc/sys/rtems/machine/_types.h index e8b2bc7e6..1711c7ae8 100644 --- a/newlib/libc/sys/rtems/machine/_types.h +++ b/newlib/libc/sys/rtems/machine/_types.h @@ -9,7 +9,6 @@ #define _HAVE_SYSTYPES #include -#include /* For FreeBSD compatibility */ typedef __int32_t blksize_t; typedef __int32_t blkcnt_t; From b5fdd3cd8e645c6eb0a8d9d426457efa7f0b18e0 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 1 Apr 2015 20:37:58 +0200 Subject: [PATCH 033/109] Drop local stdint.h and inttypes.h in favor of newlib files * include/cygwin/types.h: Include sys/_stdint.h rather than stdint.h. * include/stdint.h: Drop in favor of newlib version. * include/inttypes.h: Ditto. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 6 + winsup/cygwin/include/cygwin/types.h | 2 +- winsup/cygwin/include/inttypes.h | 267 -------------------------- winsup/cygwin/include/stdint.h | 276 --------------------------- 4 files changed, 7 insertions(+), 544 deletions(-) delete mode 100644 winsup/cygwin/include/inttypes.h delete mode 100644 winsup/cygwin/include/stdint.h diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 4ed8b2f57..a2cb34b68 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2015-04-01 Corinna Vinschen + + * include/cygwin/types.h: Include sys/_stdint.h rather than stdint.h. + * include/stdint.h: Drop in favor of newlib version. + * include/inttypes.h: Ditto. + 2015-04-01 Jon TURNEY * include/sys/ucontext.h : New header. diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h index b2974c411..85ee7c7b0 100644 --- a/winsup/cygwin/include/cygwin/types.h +++ b/winsup/cygwin/include/cygwin/types.h @@ -17,7 +17,7 @@ extern "C" { #endif -#include +#include #include #include #include diff --git a/winsup/cygwin/include/inttypes.h b/winsup/cygwin/include/inttypes.h deleted file mode 100644 index 5a646813b..000000000 --- a/winsup/cygwin/include/inttypes.h +++ /dev/null @@ -1,267 +0,0 @@ -/* inttypes.h - fixed size integer types - - Copyright 2003, 2005, 2009, 2010, 2012, 2015 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -#ifndef _INTTYPES_H -#define _INTTYPES_H - -#include -#define __need_wchar_t -#include -#include - -#if __WORDSIZE == 64 -#define __PRI64 "l" -#define __PRIFAST "l" -#define __PRIPTR "l" -#else -#define __PRI64 "ll" -#define __PRIFAST -#define __PRIPTR -#endif - -/* fprintf() macros for signed integers */ - -#define PRId8 "d" -#define PRId16 "d" -#define PRId32 "d" -#define PRId64 __PRI64 "d" - -#define PRIdLEAST8 "d" -#define PRIdLEAST16 "d" -#define PRIdLEAST32 "d" -#define PRIdLEAST64 __PRI64 "d" - -#define PRIdFAST8 "d" -#define PRIdFAST16 __PRIFAST "d" -#define PRIdFAST32 __PRIFAST "d" -#define PRIdFAST64 __PRI64 "d" - -#define PRIdMAX __PRI64 "d" -#define PRIdPTR __PRIPTR "d" - -#define PRIi8 "i" -#define PRIi16 "i" -#define PRIi32 "i" -#define PRIi64 __PRI64 "i" - -#define PRIiLEAST8 "i" -#define PRIiLEAST16 "i" -#define PRIiLEAST32 "i" -#define PRIiLEAST64 __PRI64 "i" - -#define PRIiFAST8 "i" -#define PRIiFAST16 __PRIFAST "i" -#define PRIiFAST32 __PRIFAST "i" -#define PRIiFAST64 __PRI64 "i" - -#define PRIiMAX __PRI64 "i" -#define PRIiPTR __PRIPTR "i" - -/* fprintf() macros for unsigned integers */ - -#define PRIo8 "o" -#define PRIo16 "o" -#define PRIo32 "o" -#define PRIo64 __PRI64 "o" - -#define PRIoLEAST8 "o" -#define PRIoLEAST16 "o" -#define PRIoLEAST32 "o" -#define PRIoLEAST64 __PRI64 "o" - -#define PRIoFAST8 "o" -#define PRIoFAST16 __PRIFAST "o" -#define PRIoFAST32 __PRIFAST "o" -#define PRIoFAST64 __PRI64 "o" - -#define PRIoMAX __PRI64 "o" -#define PRIoPTR __PRIPTR "o" - -#define PRIu8 "u" -#define PRIu16 "u" -#define PRIu32 "u" -#define PRIu64 __PRI64 "u" - -#define PRIuLEAST8 "u" -#define PRIuLEAST16 "u" -#define PRIuLEAST32 "u" -#define PRIuLEAST64 __PRI64 "u" - -#define PRIuFAST8 "u" -#define PRIuFAST16 __PRIFAST "u" -#define PRIuFAST32 __PRIFAST "u" -#define PRIuFAST64 __PRI64 "u" - -#define PRIuMAX __PRI64 "u" -#define PRIuPTR __PRIPTR "u" - -#define PRIx8 "x" -#define PRIx16 "x" -#define PRIx32 "x" -#define PRIx64 __PRI64 "x" - -#define PRIxLEAST8 "x" -#define PRIxLEAST16 "x" -#define PRIxLEAST32 "x" -#define PRIxLEAST64 __PRI64 "x" - -#define PRIxFAST8 "x" -#define PRIxFAST16 __PRIFAST "x" -#define PRIxFAST32 __PRIFAST "x" -#define PRIxFAST64 __PRI64 "x" - -#define PRIxMAX __PRI64 "x" -#define PRIxPTR __PRIPTR "x" - -#define PRIX8 "X" -#define PRIX16 "X" -#define PRIX32 "X" -#define PRIX64 __PRI64 "X" - -#define PRIXLEAST8 "X" -#define PRIXLEAST16 "X" -#define PRIXLEAST32 "X" -#define PRIXLEAST64 __PRI64 "X" - -#define PRIXFAST8 "X" -#define PRIXFAST16 __PRIFAST "X" -#define PRIXFAST32 __PRIFAST "X" -#define PRIXFAST64 __PRI64 "X" - -#define PRIXMAX __PRI64 "X" -#define PRIXPTR __PRIPTR "X" - -/* fscanf() macros for signed integers */ - -#if __WORDSIZE == 64 -#define __SCN64 "l" -#define __SCNFAST "l" -#define __SCNPTR "l" -#else -#define __SCN64 "ll" -#define __SCNFAST -#define __SCNPTR -#endif - -#define SCNd8 "hhd" -#define SCNd16 "hd" -#define SCNd32 "d" -#define SCNd64 __SCN64 "d" - -#define SCNdLEAST8 "hhd" -#define SCNdLEAST16 "hd" -#define SCNdLEAST32 "d" -#define SCNdLEAST64 __SCN64 "d" - -#define SCNdFAST8 "hhd" -#define SCNdFAST16 __SCNFAST "d" -#define SCNdFAST32 __SCNFAST "d" -#define SCNdFAST64 __SCN64 "d" - -#define SCNdMAX __SCN64 "d" -#define SCNdPTR __SCNPTR "d" - -#define SCNi8 "hhi" -#define SCNi16 "hi" -#define SCNi32 "i" -#define SCNi64 __SCN64 "i" - -#define SCNiLEAST8 "hhi" -#define SCNiLEAST16 "hi" -#define SCNiLEAST32 "i" -#define SCNiLEAST64 __SCN64 "i" - -#define SCNiFAST8 "hhi" -#define SCNiFAST16 __SCNFAST "i" -#define SCNiFAST32 __SCNFAST "i" -#define SCNiFAST64 __SCN64 "i" - -#define SCNiMAX __SCN64 "i" -#define SCNiPTR __SCNPTR "i" - -/* fscanf() macros for unsigned integers */ - -#define SCNo8 "hho" -#define SCNo16 "ho" -#define SCNo32 "o" -#define SCNo64 __SCN64 "o" - -#define SCNoLEAST8 "hho" -#define SCNoLEAST16 "ho" -#define SCNoLEAST32 "o" -#define SCNoLEAST64 __SCN64 "o" - -#define SCNoFAST8 "hho" -#define SCNoFAST16 __SCNFAST "o" -#define SCNoFAST32 __SCNFAST "o" -#define SCNoFAST64 __SCN64 "o" - -#define SCNoMAX __SCN64 "o" -#define SCNoPTR __SCNPTR "o" - -#define SCNu8 "hhu" -#define SCNu16 "hu" -#define SCNu32 "u" -#define SCNu64 __SCN64 "u" - -#define SCNuLEAST8 "hhu" -#define SCNuLEAST16 "hu" -#define SCNuLEAST32 "u" -#define SCNuLEAST64 __SCN64 "u" - -#define SCNuFAST8 "hhu" -#define SCNuFAST16 __SCNFAST "u" -#define SCNuFAST32 __SCNFAST "u" -#define SCNuFAST64 __SCN64 "u" - -#define SCNuMAX __SCN64 "u" -#define SCNuPTR __SCNPTR "u" - -#define SCNx8 "hhx" -#define SCNx16 "hx" -#define SCNx32 "x" -#define SCNx64 __SCN64 "x" - -#define SCNxLEAST8 "hhx" -#define SCNxLEAST16 "hx" -#define SCNxLEAST32 "x" -#define SCNxLEAST64 __SCN64 "x" - -#define SCNxFAST8 "hhx" -#define SCNxFAST16 __SCNFAST "x" -#define SCNxFAST32 __SCNFAST "x" -#define SCNxFAST64 __SCN64 "x" - -#define SCNxMAX __SCN64 "x" -#define SCNxPTR __SCNPTR "x" - -#ifdef __cplusplus -extern "C" { -#endif - -#include <_ansi.h> - -typedef struct { - intmax_t quot; - intmax_t rem; -} imaxdiv_t; - -intmax_t _EXFUN(imaxabs, (intmax_t)); -imaxdiv_t _EXFUN(imaxdiv, (intmax_t, intmax_t)); -intmax_t _EXFUN(strtoimax, (const char *, char **, int)); -uintmax_t _EXFUN(strtoumax, (const char *, char **, int)); -intmax_t _EXFUN(wcstoimax, (const wchar_t *, wchar_t **, int)); -uintmax_t _EXFUN(wcstoumax, (const wchar_t *, wchar_t **, int)); - -#ifdef __cplusplus -} -#endif - -#endif /* _INTTYPES_H */ diff --git a/winsup/cygwin/include/stdint.h b/winsup/cygwin/include/stdint.h deleted file mode 100644 index 7da9caf6f..000000000 --- a/winsup/cygwin/include/stdint.h +++ /dev/null @@ -1,276 +0,0 @@ -/* stdint.h - integer types - - Copyright 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2012 2015 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -#ifndef _STDINT_H -#define _STDINT_H - -#include - -/* Exact-width integer types */ - -#ifndef __int8_t_defined -#define __int8_t_defined -typedef signed char int8_t; -typedef short int16_t; -typedef int int32_t; -#if __WORDSIZE == 64 -typedef long int64_t; -#else -typedef long long int64_t; -#endif -#endif - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -#ifndef __uint32_t_defined -#define __uint32_t_defined -typedef unsigned int uint32_t; -#endif -#if __WORDSIZE == 64 -typedef unsigned long uint64_t; -#else -typedef unsigned long long uint64_t; -#endif - -/* Minimum-width integer types */ - -typedef signed char int_least8_t; -typedef short int_least16_t; -typedef int int_least32_t; -#if __WORDSIZE == 64 -typedef long int_least64_t; -#else -typedef long long int_least64_t; -#endif - -typedef unsigned char uint_least8_t; -typedef unsigned short uint_least16_t; -typedef unsigned int uint_least32_t; -#if __WORDSIZE == 64 -typedef unsigned long uint_least64_t; -#else -typedef unsigned long long uint_least64_t; -#endif - -/* Fastest minimum-width integer types */ - -typedef signed char int_fast8_t; -#if __WORDSIZE == 64 -typedef long int_fast16_t; -typedef long int_fast32_t; -typedef long int_fast64_t; -#else -typedef int int_fast16_t; -typedef int int_fast32_t; -typedef long long int_fast64_t; -#endif - -typedef unsigned char uint_fast8_t; -#if __WORDSIZE == 64 -typedef unsigned long uint_fast16_t; -typedef unsigned long uint_fast32_t; -typedef unsigned long uint_fast64_t; -#else -typedef unsigned int uint_fast16_t; -typedef unsigned int uint_fast32_t; -typedef unsigned long long uint_fast64_t; -#endif - -/* Integer types capable of holding object pointers */ - -#ifndef __intptr_t_defined -#define __intptr_t_defined -#if __WORDSIZE == 64 -typedef long intptr_t; -#else -typedef int intptr_t; -#endif -#endif -#if __WORDSIZE == 64 -typedef unsigned long uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif - -/* Greatest-width integer types */ - -#if __WORDSIZE == 64 -typedef long intmax_t; -typedef unsigned long uintmax_t; -#else -typedef long long intmax_t; -typedef unsigned long long uintmax_t; -#endif - -#ifdef __x86_64__ -# define __I64(n) n ## L -# define __U64(n) n ## UL -#else -# define __I64(n) n ## LL -# define __U64(n) n ## ULL -#endif - -/* Limits of exact-width integer types */ - -#define INT8_MIN (-128) -#define INT16_MIN (-32768) -#define INT32_MIN (-2147483647 - 1) -#define INT64_MIN (-__I64(9223372036854775807) - 1) - -#define INT8_MAX (127) -#define INT16_MAX (32767) -#define INT32_MAX (2147483647) -#define INT64_MAX (__I64(9223372036854775807)) - -#define UINT8_MAX (255) -#define UINT16_MAX (65535) -#define UINT32_MAX (4294967295U) -#define UINT64_MAX (__U64(18446744073709551615)) - -/* Limits of minimum-width integer types */ - -#define INT_LEAST8_MIN (-128) -#define INT_LEAST16_MIN (-32768) -#define INT_LEAST32_MIN (-2147483647 - 1) -#define INT_LEAST64_MIN (-__I64(9223372036854775807) - 1) - -#define INT_LEAST8_MAX (127) -#define INT_LEAST16_MAX (32767) -#define INT_LEAST32_MAX (2147483647) -#define INT_LEAST64_MAX (__I64(9223372036854775807)) - -#define UINT_LEAST8_MAX (255) -#define UINT_LEAST16_MAX (65535) -#define UINT_LEAST32_MAX (4294967295U) -#define UINT_LEAST64_MAX (__U64(18446744073709551615)) - -/* Limits of fastest minimum-width integer types */ - -#define INT_FAST8_MIN (-128) -#if __WORDSIZE == 64 -#define INT_FAST16_MIN (-__I64(9223372036854775807) - 1) -#define INT_FAST32_MIN (-__I64(9223372036854775807) - 1) -#else -#define INT_FAST16_MIN (-2147483647 - 1) -#define INT_FAST32_MIN (-2147483647 - 1) -#endif -#define INT_FAST64_MIN (-__I64(9223372036854775807) - 1) - -#define INT_FAST8_MAX (127) -#if __WORDSIZE == 64 -#define INT_FAST16_MAX (__I64(9223372036854775807)) -#define INT_FAST32_MAX (__I64(9223372036854775807)) -#else -#define INT_FAST16_MAX (2147483647) -#define INT_FAST32_MAX (2147483647) -#endif -#define INT_FAST64_MAX (__I64(9223372036854775807)) - -#define UINT_FAST8_MAX (255) -#if __WORDSIZE == 64 -#define UINT_FAST16_MAX (__U64(18446744073709551615)) -#define UINT_FAST32_MAX (__U64(18446744073709551615)) -#else -#define UINT_FAST16_MAX (4294967295U) -#define UINT_FAST32_MAX (4294967295U) -#endif -#define UINT_FAST64_MAX (__U64(18446744073709551615)) - -/* Limits of integer types capable of holding object pointers */ - -#if __WORDSIZE == 64 -#define INTPTR_MIN (-__I64(9223372036854775807) - 1) -#define INTPTR_MAX (__I64(9223372036854775807)) -#define UINTPTR_MAX (__U64(18446744073709551615)) -#else -#define INTPTR_MIN (-2147483647 - 1) -#define INTPTR_MAX (2147483647) -#define UINTPTR_MAX (4294967295U) -#endif - -/* Limits of greatest-width integer types */ - -#define INTMAX_MIN (-__I64(9223372036854775807) - 1) -#define INTMAX_MAX (__I64(9223372036854775807)) -#define UINTMAX_MAX (__U64(18446744073709551615)) - -/* Limits of other integer types */ - -#ifndef PTRDIFF_MIN -#if __WORDSIZE == 64 -#define PTRDIFF_MIN (-9223372036854775807L - 1) -#define PTRDIFF_MAX (9223372036854775807L) -#else -#define PTRDIFF_MIN (-2147483647 - 1) -#define PTRDIFF_MAX (2147483647) -#endif -#endif - -#ifndef SIG_ATOMIC_MIN -#define SIG_ATOMIC_MIN (-2147483647 - 1) -#endif -#ifndef SIG_ATOMIC_MAX -#define SIG_ATOMIC_MAX (2147483647) -#endif - -#ifndef SIZE_MAX -#if __WORDSIZE == 64 -#define SIZE_MAX (18446744073709551615UL) -#else -#define SIZE_MAX (4294967295U) -#endif -#endif - -#ifndef WCHAR_MIN -#ifdef __WCHAR_MIN__ -#define WCHAR_MIN __WCHAR_MIN__ -#define WCHAR_MAX __WCHAR_MAX__ -#else -#define WCHAR_MIN (0) -#define WCHAR_MAX (65535) -#endif -#endif - -#ifndef WINT_MIN -#define WINT_MIN 0U -#define WINT_MAX (4294967295U) -#endif - -/* Macros for minimum-width integer constant expressions */ - -#define INT8_C(x) x -#define INT16_C(x) x -#define INT32_C(x) x -#if __WORDSIZE == 64 -#define INT64_C(x) x ## L -#else -#define INT64_C(x) x ## LL -#endif - -#define UINT8_C(x) x -#define UINT16_C(x) x -#define UINT32_C(x) x ## U -#if __WORDSIZE == 64 -#define UINT64_C(x) x ## UL -#else -#define UINT64_C(x) x ## ULL -#endif - -/* Macros for greatest-width integer constant expressions */ - -#if __WORDSIZE == 64 -#define INTMAX_C(x) x ## L -#define UINTMAX_C(x) x ## UL -#else -#define INTMAX_C(x) x ## LL -#define UINTMAX_C(x) x ## ULL -#endif - -#endif /* _STDINT_H */ From d41baf3578d657e8c93ef326050272c1bf8df27d Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 1 Apr 2015 20:40:43 +0200 Subject: [PATCH 034/109] Add parens around MIN/MAX values in stdint.h. * libc/include/stdint.h: Throughout add parens around MIN/MAX values. Signed-off-by: Corinna Vinschen --- newlib/ChangeLog | 4 + newlib/libc/include/stdint.h | 142 +++++++++++++++++------------------ 2 files changed, 75 insertions(+), 71 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 1d43b0df2..470978d48 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2015-04-01 Corinna Vinschen + + * libc/include/stdint.h: Throughout add parens around MIN/MAX values. + 2015-04-01 Sebastian Huber * libc/include/sys/_stdint.h: New file. diff --git a/newlib/libc/include/stdint.h b/newlib/libc/include/stdint.h index a2c9fea03..aa9d68e9e 100644 --- a/newlib/libc/include/stdint.h +++ b/newlib/libc/include/stdint.h @@ -145,13 +145,13 @@ typedef __uint_least64_t uint_least64_t; #ifdef __INTPTR_TYPE__ #define INTPTR_MIN (-__INTPTR_MAX__ - 1) -#define INTPTR_MAX __INTPTR_MAX__ -#define UINTPTR_MAX __UINTPTR_MAX__ +#define INTPTR_MAX (__INTPTR_MAX__) +#define UINTPTR_MAX (__UINTPTR_MAX__) #elif defined(__PTRDIFF_TYPE__) #define INTPTR_MAX PTRDIFF_MAX #define INTPTR_MIN PTRDIFF_MIN #ifdef __UINTPTR_MAX__ -#define UINTPTR_MAX __UINTPTR_MAX__ +#define UINTPTR_MAX (__UINTPTR_MAX__) #else #define UINTPTR_MAX (2UL * PTRDIFF_MAX + 1) #endif @@ -160,7 +160,7 @@ typedef __uint_least64_t uint_least64_t; * Fallback to hardcoded values, * should be valid on cpu's with 32bit int/32bit void* */ -#define INTPTR_MAX __STDINT_EXP(LONG_MAX) +#define INTPTR_MAX (__STDINT_EXP(LONG_MAX)) #define INTPTR_MIN (-__STDINT_EXP(LONG_MAX) - 1) #define UINTPTR_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1) #endif @@ -169,77 +169,77 @@ typedef __uint_least64_t uint_least64_t; #ifdef __INT8_MAX__ #define INT8_MIN (-__INT8_MAX__ - 1) -#define INT8_MAX __INT8_MAX__ -#define UINT8_MAX __UINT8_MAX__ +#define INT8_MAX (__INT8_MAX__) +#define UINT8_MAX (__UINT8_MAX__) #elif defined(__int8_t_defined) -#define INT8_MIN -128 -#define INT8_MAX 127 -#define UINT8_MAX 255 +#define INT8_MIN (-128) +#define INT8_MAX (127) +#define UINT8_MAX (255) #endif #ifdef __INT_LEAST8_MAX__ #define INT_LEAST8_MIN (-__INT_LEAST8_MAX__ - 1) -#define INT_LEAST8_MAX __INT_LEAST8_MAX__ -#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__ +#define INT_LEAST8_MAX (__INT_LEAST8_MAX__) +#define UINT_LEAST8_MAX (__UINT_LEAST8_MAX__) #elif defined(__int_least8_t_defined) -#define INT_LEAST8_MIN -128 -#define INT_LEAST8_MAX 127 -#define UINT_LEAST8_MAX 255 +#define INT_LEAST8_MIN (-128) +#define INT_LEAST8_MAX (127) +#define UINT_LEAST8_MAX (255) #else #error required type int_least8_t missing #endif #ifdef __INT16_MAX__ #define INT16_MIN (-__INT16_MAX__ - 1) -#define INT16_MAX __INT16_MAX__ -#define UINT16_MAX __UINT16_MAX__ +#define INT16_MAX (__INT16_MAX__) +#define UINT16_MAX (__UINT16_MAX__) #elif defined(__int16_t_defined) -#define INT16_MIN -32768 -#define INT16_MAX 32767 -#define UINT16_MAX 65535 +#define INT16_MIN (-32768) +#define INT16_MAX (32767) +#define UINT16_MAX (65535) #endif #ifdef __INT_LEAST16_MAX__ #define INT_LEAST16_MIN (-__INT_LEAST16_MAX__ - 1) -#define INT_LEAST16_MAX __INT_LEAST16_MAX__ -#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__ +#define INT_LEAST16_MAX (__INT_LEAST16_MAX__) +#define UINT_LEAST16_MAX (__UINT_LEAST16_MAX__) #elif defined(__int_least16_t_defined) -#define INT_LEAST16_MIN -32768 -#define INT_LEAST16_MAX 32767 -#define UINT_LEAST16_MAX 65535 +#define INT_LEAST16_MIN (-32768) +#define INT_LEAST16_MAX (32767) +#define UINT_LEAST16_MAX (65535) #else #error required type int_least16_t missing #endif #ifdef __INT32_MAX__ #define INT32_MIN (-__INT32_MAX__ - 1) -#define INT32_MAX __INT32_MAX__ -#define UINT32_MAX __UINT32_MAX__ +#define INT32_MAX (__INT32_MAX__) +#define UINT32_MAX (__UINT32_MAX__) #elif defined(__int32_t_defined) #if __have_long32 #define INT32_MIN (-2147483647L-1) -#define INT32_MAX 2147483647L -#define UINT32_MAX 4294967295UL +#define INT32_MAX (2147483647L) +#define UINT32_MAX (4294967295UL) #else #define INT32_MIN (-2147483647-1) -#define INT32_MAX 2147483647 -#define UINT32_MAX 4294967295U +#define INT32_MAX (2147483647) +#define UINT32_MAX (4294967295U) #endif #endif #ifdef __INT_LEAST32_MAX__ #define INT_LEAST32_MIN (-__INT_LEAST32_MAX__ - 1) -#define INT_LEAST32_MAX __INT_LEAST32_MAX__ -#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__ +#define INT_LEAST32_MAX (__INT_LEAST32_MAX__) +#define UINT_LEAST32_MAX (__UINT_LEAST32_MAX__) #elif defined(__int_least32_t_defined) #if __have_long32 #define INT_LEAST32_MIN (-2147483647L-1) -#define INT_LEAST32_MAX 2147483647L -#define UINT_LEAST32_MAX 4294967295UL +#define INT_LEAST32_MAX (2147483647L) +#define UINT_LEAST32_MAX (4294967295UL) #else #define INT_LEAST32_MIN (-2147483647-1) -#define INT_LEAST32_MAX 2147483647 -#define UINT_LEAST32_MAX 4294967295U +#define INT_LEAST32_MAX (2147483647) +#define UINT_LEAST32_MAX (4294967295U) #endif #else #error required type int_least32_t missing @@ -247,44 +247,44 @@ typedef __uint_least64_t uint_least64_t; #ifdef __INT64_MAX__ #define INT64_MIN (-__INT64_MAX__ - 1) -#define INT64_MAX __INT64_MAX__ -#define UINT64_MAX __UINT64_MAX__ +#define INT64_MAX (__INT64_MAX__) +#define UINT64_MAX (__UINT64_MAX__) #elif defined(__int64_t_defined) #if __have_long64 #define INT64_MIN (-9223372036854775807L-1L) -#define INT64_MAX 9223372036854775807L -#define UINT64_MAX 18446744073709551615U +#define INT64_MAX (9223372036854775807L) +#define UINT64_MAX (18446744073709551615U) #elif __have_longlong64 #define INT64_MIN (-9223372036854775807LL-1LL) -#define INT64_MAX 9223372036854775807LL -#define UINT64_MAX 18446744073709551615ULL +#define INT64_MAX (9223372036854775807LL) +#define UINT64_MAX (18446744073709551615ULL) #endif #endif #ifdef __INT_LEAST64_MAX__ #define INT_LEAST64_MIN (-__INT_LEAST64_MAX__ - 1) -#define INT_LEAST64_MAX __INT_LEAST64_MAX__ -#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__ +#define INT_LEAST64_MAX (__INT_LEAST64_MAX__) +#define UINT_LEAST64_MAX (__UINT_LEAST64_MAX__) #elif defined(__int_least64_t_defined) #if __have_long64 #define INT_LEAST64_MIN (-9223372036854775807L-1L) -#define INT_LEAST64_MAX 9223372036854775807L -#define UINT_LEAST64_MAX 18446744073709551615U +#define INT_LEAST64_MAX (9223372036854775807L) +#define UINT_LEAST64_MAX (18446744073709551615U) #elif __have_longlong64 #define INT_LEAST64_MIN (-9223372036854775807LL-1LL) -#define INT_LEAST64_MAX 9223372036854775807LL -#define UINT_LEAST64_MAX 18446744073709551615ULL +#define INT_LEAST64_MAX (9223372036854775807LL) +#define UINT_LEAST64_MAX (18446744073709551615ULL) #endif #endif #ifdef __INT_FAST8_MAX__ #define INT_FAST8_MIN (-__INT_FAST8_MAX__ - 1) -#define INT_FAST8_MAX __INT_FAST8_MAX__ -#define UINT_FAST8_MAX __UINT_FAST8_MAX__ +#define INT_FAST8_MAX (__INT_FAST8_MAX__) +#define UINT_FAST8_MAX (__UINT_FAST8_MAX__) #elif defined(__int_fast8_t_defined) #if __STDINT_EXP(INT_MAX) >= 0x7f #define INT_FAST8_MIN (-__STDINT_EXP(INT_MAX)-1) -#define INT_FAST8_MAX __STDINT_EXP(INT_MAX) +#define INT_FAST8_MAX (__STDINT_EXP(INT_MAX)) #define UINT_FAST8_MAX (__STDINT_EXP(INT_MAX)*2U+1U) #else #define INT_FAST8_MIN INT_LEAST8_MIN @@ -295,12 +295,12 @@ typedef __uint_least64_t uint_least64_t; #ifdef __INT_FAST16_MAX__ #define INT_FAST16_MIN (-__INT_FAST16_MAX__ - 1) -#define INT_FAST16_MAX __INT_FAST16_MAX__ -#define UINT_FAST16_MAX __UINT_FAST16_MAX__ +#define INT_FAST16_MAX (__INT_FAST16_MAX__) +#define UINT_FAST16_MAX (__UINT_FAST16_MAX__) #elif defined(__int_fast16_t_defined) #if __STDINT_EXP(INT_MAX) >= 0x7fff #define INT_FAST16_MIN (-__STDINT_EXP(INT_MAX)-1) -#define INT_FAST16_MAX __STDINT_EXP(INT_MAX) +#define INT_FAST16_MAX (__STDINT_EXP(INT_MAX)) #define UINT_FAST16_MAX (__STDINT_EXP(INT_MAX)*2U+1U) #else #define INT_FAST16_MIN INT_LEAST16_MIN @@ -311,12 +311,12 @@ typedef __uint_least64_t uint_least64_t; #ifdef __INT_FAST32_MAX__ #define INT_FAST32_MIN (-__INT_FAST32_MAX__ - 1) -#define INT_FAST32_MAX __INT_FAST32_MAX__ -#define UINT_FAST32_MAX __UINT_FAST32_MAX__ +#define INT_FAST32_MAX (__INT_FAST32_MAX__) +#define UINT_FAST32_MAX (__UINT_FAST32_MAX__) #elif defined(__int_fast32_t_defined) #if __STDINT_EXP(INT_MAX) >= 0x7fffffff #define INT_FAST32_MIN (-__STDINT_EXP(INT_MAX)-1) -#define INT_FAST32_MAX __STDINT_EXP(INT_MAX) +#define INT_FAST32_MAX (__STDINT_EXP(INT_MAX)) #define UINT_FAST32_MAX (__STDINT_EXP(INT_MAX)*2U+1U) #else #define INT_FAST32_MIN INT_LEAST32_MIN @@ -327,12 +327,12 @@ typedef __uint_least64_t uint_least64_t; #ifdef __INT_FAST64_MAX__ #define INT_FAST64_MIN (-__INT_FAST64_MAX__ - 1) -#define INT_FAST64_MAX __INT_FAST64_MAX__ -#define UINT_FAST64_MAX __UINT_FAST64_MAX__ +#define INT_FAST64_MAX (__INT_FAST64_MAX__) +#define UINT_FAST64_MAX (__UINT_FAST64_MAX__) #elif defined(__int_fast64_t_defined) #if __STDINT_EXP(INT_MAX) > 0x7fffffff #define INT_FAST64_MIN (-__STDINT_EXP(INT_MAX)-1) -#define INT_FAST64_MAX __STDINT_EXP(INT_MAX) +#define INT_FAST64_MAX (__STDINT_EXP(INT_MAX)) #define UINT_FAST64_MAX (__STDINT_EXP(INT_MAX)*2U+1U) #else #define INT_FAST64_MIN INT_LEAST64_MIN @@ -342,7 +342,7 @@ typedef __uint_least64_t uint_least64_t; #endif #ifdef __INTMAX_MAX__ -#define INTMAX_MAX __INTMAX_MAX__ +#define INTMAX_MAX (__INTMAX_MAX__) #define INTMAX_MIN (-INTMAX_MAX - 1) #elif defined(__INTMAX_TYPE__) /* All relevant GCC versions prefer long to long long for intmax_t. */ @@ -351,7 +351,7 @@ typedef __uint_least64_t uint_least64_t; #endif #ifdef __UINTMAX_MAX__ -#define UINTMAX_MAX __UINTMAX_MAX__ +#define UINTMAX_MAX (__UINTMAX_MAX__) #elif defined(__UINTMAX_TYPE__) /* All relevant GCC versions prefer long to long long for intmax_t. */ #define UINTMAX_MAX UINT64_MAX @@ -359,27 +359,27 @@ typedef __uint_least64_t uint_least64_t; /* This must match size_t in stddef.h, currently long unsigned int */ #ifdef __SIZE_MAX__ -#define SIZE_MAX __SIZE_MAX__ +#define SIZE_MAX (__SIZE_MAX__) #else #define SIZE_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1) #endif /* This must match sig_atomic_t in (currently int) */ #define SIG_ATOMIC_MIN (-__STDINT_EXP(INT_MAX) - 1) -#define SIG_ATOMIC_MAX __STDINT_EXP(INT_MAX) +#define SIG_ATOMIC_MAX (__STDINT_EXP(INT_MAX)) /* This must match ptrdiff_t in (currently long int) */ #ifdef __PTRDIFF_MAX__ -#define PTRDIFF_MAX __PTRDIFF_MAX__ +#define PTRDIFF_MAX (__PTRDIFF_MAX__) #else -#define PTRDIFF_MAX __STDINT_EXP(LONG_MAX) +#define PTRDIFF_MAX (__STDINT_EXP(LONG_MAX)) #endif #define PTRDIFF_MIN (-PTRDIFF_MAX - 1) /* This must match definition in */ #ifndef WCHAR_MIN #ifdef __WCHAR_MIN__ -#define WCHAR_MIN __WCHAR_MIN__ +#define WCHAR_MIN (__WCHAR_MIN__) #elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0) #define WCHAR_MIN (0 + L'\0') #else @@ -390,7 +390,7 @@ typedef __uint_least64_t uint_least64_t; /* This must match definition in */ #ifndef WCHAR_MAX #ifdef __WCHAR_MAX__ -#define WCHAR_MAX __WCHAR_MAX__ +#define WCHAR_MAX (__WCHAR_MAX__) #elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0) #define WCHAR_MAX (0xffffffffu + L'\0') #else @@ -400,14 +400,14 @@ typedef __uint_least64_t uint_least64_t; /* wint_t is unsigned int on almost all GCC targets. */ #ifdef __WINT_MAX__ -#define WINT_MAX __WINT_MAX__ +#define WINT_MAX (__WINT_MAX__) #else #define WINT_MAX (__STDINT_EXP(INT_MAX) * 2U + 1U) #endif #ifdef __WINT_MIN__ -#define WINT_MIN __WINT_MIN__ +#define WINT_MIN (__WINT_MIN__) #else -#define WINT_MIN 0U +#define WINT_MIN (0U) #endif /** Macros for minimum-width integer constant expressions */ From ca973c0224463c05ac5dc249cd40032619808d48 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 2 Apr 2015 13:46:04 +0200 Subject: [PATCH 035/109] Drop unused parameter from add_access_*_ace * security.cc (add_access_allowed_ace): Drop unused parameter "offset". Accommodate throughout. (add_access_denied_ace): Ditto. * sec_acl.cc: Accommodate above change throughout. * security.h (add_access_allowed_ace): Adjust prototype to above change. (add_access_denied_ace): Ditto. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 9 +++++++ winsup/cygwin/sec_acl.cc | 46 ++++++++++++++++------------------- winsup/cygwin/security.cc | 50 +++++++++++++++++++-------------------- winsup/cygwin/security.h | 4 ++-- 4 files changed, 56 insertions(+), 53 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index a2cb34b68..b2472a883 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,12 @@ +2015-04-02 Corinna Vinschen + + * security.cc (add_access_allowed_ace): Drop unused parameter "offset". + Accommodate throughout. + (add_access_denied_ace): Ditto. + * sec_acl.cc: Accommodate above change throughout. + * security.h (add_access_allowed_ace): Adjust prototype to above change. + (add_access_denied_ace): Ditto. + 2015-04-01 Corinna Vinschen * include/cygwin/types.h: Include sys/_stdint.h rather than stdint.h. diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index aa1833920..c2470b3b4 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -171,7 +171,6 @@ setacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp, /* Fill access control list. */ acl = (PACL) tp.w_get (); size_t acl_len = sizeof (ACL); - int ace_off = 0; cygsid sid; struct passwd *pw; @@ -236,37 +235,37 @@ setacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp, /* Set deny ACE for owner. */ if (owner_deny - && !add_access_denied_ace (acl, ace_off++, owner_deny, - owner, acl_len, NO_INHERITANCE)) + && !add_access_denied_ace (acl, owner_deny, owner, acl_len, + NO_INHERITANCE)) return -1; /* Set deny ACE for group here to respect the canonical order, if this does not impact owner */ if (group_deny && !(group_deny & owner_allow) && !isownergroup - && !add_access_denied_ace (acl, ace_off++, group_deny, - group, acl_len, NO_INHERITANCE)) + && !add_access_denied_ace (acl, group_deny, group, acl_len, + NO_INHERITANCE)) return -1; /* Set allow ACE for owner. */ - if (!add_access_allowed_ace (acl, ace_off++, owner_allow, - owner, acl_len, NO_INHERITANCE)) + if (!add_access_allowed_ace (acl, owner_allow, owner, acl_len, + NO_INHERITANCE)) return -1; /* Set deny ACE for group, if still needed. */ if (group_deny & owner_allow && !isownergroup - && !add_access_denied_ace (acl, ace_off++, group_deny, - group, acl_len, NO_INHERITANCE)) + && !add_access_denied_ace (acl, group_deny, group, acl_len, + NO_INHERITANCE)) return -1; /* Set allow ACE for group. */ if (!isownergroup - && !add_access_allowed_ace (acl, ace_off++, group_allow, - group, acl_len, NO_INHERITANCE)) + && !add_access_allowed_ace (acl, group_allow, group, acl_len, + NO_INHERITANCE)) return -1; /* Set allow ACE for everyone. */ - if (!add_access_allowed_ace (acl, ace_off++, other_allow, - well_known_world_sid, acl_len, NO_INHERITANCE)) + if (!add_access_allowed_ace (acl, other_allow, well_known_world_sid, acl_len, + NO_INHERITANCE)) return -1; /* If a NULL ACE exists, copy it verbatim. */ if (null_mask) - if (!add_access_allowed_ace (acl, ace_off++, null_mask, well_known_null_sid, - acl_len, NO_INHERITANCE)) + if (!add_access_allowed_ace (acl, null_mask, well_known_null_sid, acl_len, + NO_INHERITANCE)) return -1; for (int i = 0; i < nentries; ++i) { @@ -317,8 +316,8 @@ setacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp, case DEF_USER_OBJ: allow |= STANDARD_RIGHTS_ALL | (pc.fs_is_samba () ? 0 : FILE_WRITE_ATTRIBUTES); - if (!add_access_allowed_ace (acl, ace_off++, allow, - well_known_creator_owner_sid, acl_len, inheritance)) + if (!add_access_allowed_ace (acl, allow, well_known_creator_owner_sid, + acl_len, inheritance)) return -1; break; case USER: @@ -329,13 +328,12 @@ setacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp, set_errno (EINVAL); return -1; } - if (!add_access_allowed_ace (acl, ace_off++, allow, - sid, acl_len, inheritance)) + if (!add_access_allowed_ace (acl, allow, sid, acl_len, inheritance)) return -1; break; case DEF_GROUP_OBJ: - if (!add_access_allowed_ace (acl, ace_off++, allow, - well_known_creator_group_sid, acl_len, inheritance)) + if (!add_access_allowed_ace (acl, allow, well_known_creator_group_sid, + acl_len, inheritance)) return -1; break; case GROUP: @@ -346,13 +344,11 @@ setacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp, set_errno (EINVAL); return -1; } - if (!add_access_allowed_ace (acl, ace_off++, allow, - sid, acl_len, inheritance)) + if (!add_access_allowed_ace (acl, allow, sid, acl_len, inheritance)) return -1; break; case DEF_OTHER_OBJ: - if (!add_access_allowed_ace (acl, ace_off++, allow, - well_known_world_sid, + if (!add_access_allowed_ace (acl, allow, well_known_world_sid, acl_len, inheritance)) return -1; } diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index e6cbd4cd5..c50f515cf 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -311,8 +311,8 @@ get_file_attribute (HANDLE handle, path_conv &pc, } bool -add_access_allowed_ace (PACL acl, int offset, DWORD attributes, - PSID sid, size_t &len_add, DWORD inherit) +add_access_allowed_ace (PACL acl, DWORD attributes, PSID sid, size_t &len_add, + DWORD inherit) { NTSTATUS status = RtlAddAccessAllowedAceEx (acl, ACL_REVISION, inherit, attributes, sid); @@ -326,8 +326,8 @@ add_access_allowed_ace (PACL acl, int offset, DWORD attributes, } bool -add_access_denied_ace (PACL acl, int offset, DWORD attributes, - PSID sid, size_t &len_add, DWORD inherit) +add_access_denied_ace (PACL acl, DWORD attributes, PSID sid, size_t &len_add, + DWORD inherit) { NTSTATUS status = RtlAddAccessDeniedAceEx (acl, ACL_REVISION, inherit, attributes, sid); @@ -421,7 +421,6 @@ alloc_sd (path_conv &pc, uid_t uid, gid_t gid, int attribute, /* From here fill ACL. */ size_t acl_len = sizeof (ACL); - int ace_off = 0; /* Only used for sync objects (for ttys). The admins group should always have the right to manipulate the ACL, so we have to make sure that the ACL gives the admins group STANDARD_RIGHTS_ALL access. */ @@ -507,35 +506,35 @@ alloc_sd (path_conv &pc, uid_t uid, gid_t gid, int attribute, /* Set deny ACE for owner. */ if (owner_deny - && !add_access_denied_ace (acl, ace_off++, owner_deny, - owner_sid, acl_len, NO_INHERITANCE)) + && !add_access_denied_ace (acl, owner_deny, owner_sid, acl_len, + NO_INHERITANCE)) return NULL; /* Set deny ACE for group here to respect the canonical order, if this does not impact owner */ if (group_deny && !(group_deny & owner_allow) && !isownergroup - && !add_access_denied_ace (acl, ace_off++, group_deny, - group_sid, acl_len, NO_INHERITANCE)) + && !add_access_denied_ace (acl, group_deny, group_sid, acl_len, + NO_INHERITANCE)) return NULL; /* Set allow ACE for owner. */ - if (!add_access_allowed_ace (acl, ace_off++, owner_allow, - owner_sid, acl_len, NO_INHERITANCE)) + if (!add_access_allowed_ace (acl, owner_allow, owner_sid, acl_len, + NO_INHERITANCE)) return NULL; /* Set deny ACE for group, if still needed. */ if ((group_deny & owner_allow) && !isownergroup - && !add_access_denied_ace (acl, ace_off++, group_deny, - group_sid, acl_len, NO_INHERITANCE)) + && !add_access_denied_ace (acl, group_deny, group_sid, acl_len, + NO_INHERITANCE)) return NULL; /* Set allow ACE for group. */ if (!isownergroup - && !add_access_allowed_ace (acl, ace_off++, group_allow, - group_sid, acl_len, NO_INHERITANCE)) + && !add_access_allowed_ace (acl, group_allow, group_sid, acl_len, + NO_INHERITANCE)) return NULL; /* For sync objects, if we didn't see the admins group so far, add entry with STANDARD_RIGHTS_ALL access. */ if (S_ISCHR (attribute) && !saw_admins) { - if (!add_access_allowed_ace (acl, ace_off++, STANDARD_RIGHTS_ALL, + if (!add_access_allowed_ace (acl, STANDARD_RIGHTS_ALL, well_known_admins_sid, acl_len, NO_INHERITANCE)) return NULL; @@ -543,13 +542,13 @@ alloc_sd (path_conv &pc, uid_t uid, gid_t gid, int attribute, } /* Set allow ACE for everyone. */ - if (!add_access_allowed_ace (acl, ace_off++, other_allow, - well_known_world_sid, acl_len, NO_INHERITANCE)) + if (!add_access_allowed_ace (acl, other_allow, well_known_world_sid, acl_len, + NO_INHERITANCE)) return NULL; /* Set null ACE for special bits. */ if (null_allow - && !add_access_allowed_ace (acl, ace_off++, null_allow, - well_known_null_sid, acl_len, NO_INHERITANCE)) + && !add_access_allowed_ace (acl, null_allow, well_known_null_sid, acl_len, + NO_INHERITANCE)) return NULL; /* Fill ACL with unrelated ACEs from current security descriptor. */ @@ -637,7 +636,6 @@ alloc_sd (path_conv &pc, uid_t uid, gid_t gid, int attribute, __seterrno_from_nt_status (status); return NULL; } - ace_off++; acl_len += ace->Header.AceSize; } @@ -648,18 +646,18 @@ alloc_sd (path_conv &pc, uid_t uid, gid_t gid, int attribute, { const DWORD inherit = SUB_CONTAINERS_AND_OBJECTS_INHERIT | INHERIT_ONLY; /* Set allow ACE for owner. */ - if (!add_access_allowed_ace (acl, ace_off++, owner_allow, + if (!add_access_allowed_ace (acl, owner_allow, well_known_creator_owner_sid, acl_len, inherit)) return NULL; /* Set allow ACE for group. */ - if (!add_access_allowed_ace (acl, ace_off++, group_allow, + if (!add_access_allowed_ace (acl, group_allow, well_known_creator_group_sid, acl_len, inherit)) return NULL; /* Set allow ACE for everyone. */ - if (!add_access_allowed_ace (acl, ace_off++, other_allow, - well_known_world_sid, acl_len, inherit)) + if (!add_access_allowed_ace (acl, other_allow, well_known_world_sid, + acl_len, inherit)) return NULL; } @@ -955,7 +953,7 @@ convert_samba_sd (security_descriptor &sd_ret) if (gid < UNIX_POSIX_OFFSET && (grp = internal_getgrgid (gid))) ace_sid.getfromgr (grp); } - if (!add_access_allowed_ace (acl, i, ace->Mask, ace_sid, acl_len, + if (!add_access_allowed_ace (acl, ace->Mask, ace_sid, acl_len, ace->Header.AceFlags)) return; } diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h index 9457eba6b..7bf0270ef 100644 --- a/winsup/cygwin/security.h +++ b/winsup/cygwin/security.h @@ -449,8 +449,8 @@ int __reg3 set_object_sd (HANDLE, security_descriptor &, bool); int __reg3 get_reg_attribute (HKEY hkey, mode_t *, uid_t *, gid_t *); LONG __reg3 get_file_sd (HANDLE fh, path_conv &, security_descriptor &, bool); LONG __reg3 set_file_sd (HANDLE fh, path_conv &, security_descriptor &, bool); -bool __reg3 add_access_allowed_ace (PACL, int, DWORD, PSID, size_t &, DWORD); -bool __reg3 add_access_denied_ace (PACL, int, DWORD, PSID, size_t &, DWORD); +bool __reg3 add_access_allowed_ace (PACL, DWORD, PSID, size_t &, DWORD); +bool __reg3 add_access_denied_ace (PACL, DWORD, PSID, size_t &, DWORD); int __reg3 check_file_access (path_conv &, int, bool); int __reg3 check_registry_access (HANDLE, int, bool); From 94bb7da6b4a7b8400ede75e000c9df1f15588b22 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 2 Apr 2015 13:48:55 +0200 Subject: [PATCH 036/109] Rename index variable from i to idx. * sec_acl.cc (CYG_ACE_ISBITS_TO_WIN): Fix typo. (get_posix_access): Rename index variable from i to idx. Define only once at top level. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/sec_acl.cc | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b2472a883..9871b9698 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2015-04-02 Corinna Vinschen + + * sec_acl.cc (CYG_ACE_ISBITS_TO_WIN): Fix typo. + (get_posix_access): Rename index variable from i to idx. Define only + once at top level. + 2015-04-02 Corinna Vinschen * security.cc (add_access_allowed_ace): Drop unused parameter "offset". diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index c2470b3b4..749ba9437 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -69,7 +69,7 @@ details. */ #define CYG_ACE_ISBITS_TO_POSIX(val) \ (((val) & 0x007) << 9) #define CYG_ACE_ISBITS_TO_WIN(val) \ - (((val) & (S_ISVTX | S_ISUID | S_IS_GID)) >> 9) + (((val) & (S_ISVTX | S_ISUID | S_ISGID)) >> 9) #define CYG_ACE_MASK_X 0x008 /* 0x001 <-> 0x008 */ #define CYG_ACE_MASK_W 0x010 /* 0x002 <-> 0x010 */ @@ -449,7 +449,7 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, mode_t attr = 0; aclent_t *lacl = NULL; cygpsid ace_sid; - int pos, type, id; + int pos, type, id, idx; bool new_style = false; bool saw_user_obj = false; @@ -536,9 +536,9 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, goto out; } - for (int i = 0; i < acl->AceCount; ++i) + for (idx = 0; idx < acl->AceCount; ++idx) { - if (!NT_SUCCESS (RtlGetAce (acl, i, (PVOID *) &ace))) + if (!NT_SUCCESS (RtlGetAce (acl, idx, (PVOID *) &ace))) continue; ace_sid = (PSID) &ace->SidStart; @@ -745,13 +745,13 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, /* For old-style or non-Cygwin ACLs, check for merging permissions. */ if (!new_style) - for (int i = 0; i < pos; ++i) + for (idx = 0; idx < pos; ++idx) { /* Current user? If the user entry has a deny ACE, don't check. */ - if (lacl[i].a_id == myself->uid - && lacl[i].a_type & (USER_OBJ | USER) - && !(lacl[i].a_type & ACL_DEFAULT) - && !(lacl[i].a_perm & DENY_RWX)) + if (lacl[idx].a_id == myself->uid + && lacl[idx].a_type & (USER_OBJ | USER) + && !(lacl[idx].a_type & ACL_DEFAULT) + && !(lacl[idx].a_perm & DENY_RWX)) { int gpos; gid_t grps[NGROUPS_MAX]; @@ -766,14 +766,14 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, || (gpos = searchace (lacl, MAX_ACL_ENTRIES, GROUP, grps[g])) >= 0) grp_perm |= lacl[gpos].a_perm & S_IRWXO; - lacl[i].a_perm |= grp_perm; + lacl[idx].a_perm |= grp_perm; } /* For all groups, if everyone has more permissions, add everyone perms to group perms. Skip groups with deny ACE. */ - else if (lacl[i].a_id & (GROUP_OBJ | GROUP) - && !(lacl[i].a_type & ACL_DEFAULT) - && !(lacl[i].a_perm & DENY_RWX)) - lacl[i].a_perm |= lacl[2].a_perm & S_IRWXO; + else if (lacl[idx].a_id & (GROUP_OBJ | GROUP) + && !(lacl[idx].a_type & ACL_DEFAULT) + && !(lacl[idx].a_perm & DENY_RWX)) + lacl[idx].a_perm |= lacl[2].a_perm & S_IRWXO; } /* Construct POSIX permission bits. Fortunately we know exactly where to fetch the affecting bits from, at least as long as the array @@ -797,8 +797,8 @@ out: return -1; } memcpy (aclbufp, lacl, pos * sizeof (aclent_t)); - for (int i = 0; i < pos; ++i) - aclbufp[i].a_perm &= S_IRWXO; + for (idx = 0; idx < pos; ++idx) + aclbufp[idx].a_perm &= S_IRWXO; aclsort32 (pos, 0, aclbufp); } return pos; From cbb9849fa76f1dbe6c66d91b68d9a10f46f1ba69 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 2 Apr 2015 18:05:32 +0100 Subject: [PATCH 037/109] Try to make sure struct _mcontext is 16-byte aligned On x86_64, RtlCaptureContext() uses fxsave to save FPU/MMX/SSE state. fxsave requires that the destination address is 16-byte aligned, or it will fault. CONTEXT is already annotated __attribute__ ((aligned (16))), do the same with struct _mcontext. Rearrange ucontext_t so that it's struct _mcontext element is also correctly aligned. * include/cygwin/signal.h (struct __mcontext): 16-byte align. * include/sys/ucontext.h (ucontext_t): Ditto. Signed-off-by: Jon TURNEY --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/include/cygwin/signal.h | 2 +- winsup/cygwin/include/sys/ucontext.h | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9871b9698..3b0e11187 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-02 Jon TURNEY + + * include/cygwin/signal.h (struct __mcontext): 16-byte align. + * include/sys/ucontext.h (ucontext_t): Ditto. + 2015-04-02 Corinna Vinschen * sec_acl.cc (CYG_ACE_ISBITS_TO_WIN): Fix typo. diff --git a/winsup/cygwin/include/cygwin/signal.h b/winsup/cygwin/include/cygwin/signal.h index 04e65aa34..ef29baf7b 100644 --- a/winsup/cygwin/include/cygwin/signal.h +++ b/winsup/cygwin/include/cygwin/signal.h @@ -49,7 +49,7 @@ struct _fpstate __uint32_t padding[24]; }; -struct __mcontext +struct __attribute__ ((aligned (16))) __mcontext { __uint64_t p1home; __uint64_t p2home; diff --git a/winsup/cygwin/include/sys/ucontext.h b/winsup/cygwin/include/sys/ucontext.h index 9362d90cd..65485fbad 100644 --- a/winsup/cygwin/include/sys/ucontext.h +++ b/winsup/cygwin/include/sys/ucontext.h @@ -15,11 +15,11 @@ details. */ typedef struct __mcontext mcontext_t; -typedef struct __ucontext { +typedef __attribute__ ((aligned (16))) struct __ucontext { + mcontext_t uc_mcontext; struct __ucontext *uc_link; sigset_t uc_sigmask; stack_t uc_stack; - mcontext_t uc_mcontext; unsigned long int uc_flags; } ucontext_t; From 78cfc586c88426f6b38eeb2fcbff0b55eb2b3e3a Mon Sep 17 00:00:00 2001 From: "David A. Wheeler" Date: Thu, 2 Apr 2015 14:04:55 -0400 Subject: [PATCH 038/109] Add FAQ entry on how Cygwin counters install and update MITM attacks * faq-setup.xml: Document how Cygwin secures installation and update against man-in-the-middle (MITM) attacks. Note that setup embeds a public key to check the signature of setup.ini, and that setup.ini includes SHA-512 cryptographic hashes. Signed-off-by: David A. Wheeler --- winsup/doc/ChangeLog | 7 +++ winsup/doc/faq-setup.xml | 121 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 127 insertions(+), 1 deletion(-) diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index 30d9fdc6f..416390034 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,3 +1,10 @@ +2015-04-02 David A. Wheeler + + * faq-setup.xml: Document how Cygwin secures installation and + update against man-in-the-middle (MITM) attacks. Note that + setup embeds a public key to check the signature of setup.ini, + and that setup.ini includes SHA-512 cryptographic hashes. + 2015-03-31 Jon TURNEY * misc-funcs.xml (cygwin_internal): Correct return type. diff --git a/winsup/doc/faq-setup.xml b/winsup/doc/faq-setup.xml index 614d4a95c..2a4c507ec 100644 --- a/winsup/doc/faq-setup.xml +++ b/winsup/doc/faq-setup.xml @@ -156,6 +156,120 @@ and that installing the older version will not help improve Cygwin. + +How does Cygwin secure the installation and update process? + + + +Here is how Cygwin secures the installation and update process to counter +man-in-the-middle (MITM) attacks: + + + +The Cygwin website provides the setup program +(setup-x86.exe or setup-x86_64.exe) +using HTTPS (SSL/TLS). +This authenticates that the setup program +came from the Cygwin website +(users simply use their web browsers to download the setup program). +You can use tools like Qualsys' SSL Server Test, +, +to check the HTTPS configuration of Cygwin. +The cygwin.com site supports HTTP Strict Transport Security (HSTS), +which forces the browser to keep using HTTPS once the browser has seen +it before (this counters many downgrade attacks). + +The setup program has the +Cygwin public key embedded in it. +The Cygwin public key is protected from attacker subversion +during transmission by the previous step, and this public +key is then used to protect all later steps. +You can confirm that the key is in setup by looking at the setup project +() +source code file cyg-pubkey.h +(the key is automatically generated from file cygwin.pub). + +The setup program downloads +the package list setup.ini from a mirror +and checks its digital signature. +The package list is in the file +setup.bz2 (compressed) or +setup.ini (uncompressed) on the selected mirror. +The package list includes for every official Cygwin package +the package name, cryptographic hash, and length (in bytes). +The setup program also gets the relevant .sig +(signature) file for that package list, and checks that the package list +is properly signed with the Cygwin public key embedded in the setup program. +A mirror could corrupt the package list and/or signature, but this +would be detected by setup program's signature detection +(unless you use the -X option to disable signature checking). +The setup program also checks the package list +timestamp/version and reports to the user if the file +goes backwards in time; that process detects downgrade attacks +(e.g., where an attacker subverts a mirror to send a signed package list +that is older than the currently-downloaded version). + +The packages to be installed +(which may be updates) are downloaded and both their +lengths and cryptographic hashes +(from the signed setup.{bz2,ini} file) are checked. +Non-matching packages are rejected, countering any attacker's +attempt to subvert the files on a mirror. +Cygwin currently uses the cryptographic hash function SHA-512 +for the setup.ini files. + + + + +Cygwin uses the cryptographic hash algorithm SHA-512 as of 2015-03-23. +The earlier 2015-02-06 update of the setup program added support for SHA-512 +(Cygwin previously used MD5). +There are no known practical exploits of SHA-512 (SHA-512 is part of the +widely-used SHA-2 suite of cryptographic hashes). + + + + + +What else can I do to ensure that my installation and updates are secure? + + + +To best secure your installation and update process, download +the setup program setup-x86.exe (32-bit) or +setup-x86_64.exe (64-bit), and then +check its signature (using a signature-checking tool you trust) +using the Cygwin public key +(). +This was noted on the front page for installing and updating. + + +If you use the actual Cygwin public key, and have an existing secure +signature-checking process, you will counter many other +attacks such as subversion of the Cygwin website and +malicious certificates issued by untrustworthy certificate authorities (CAs). +One challenge, of course, is ensuring that +you have the actual Cygwin public key. +You can increase confidence in the Cygwin public key by checking older copies +of the Cygwin public key (to see if it's been the same over time). +Another challenge is having a secure signature-checking process. +You can use GnuPG to check signatures; if you have a trusted Cygwin +installation you can install GnuPG. +Otherwise, to check the signature you must use an existing trusted tool or +install a signature-checking tool you can trust. + + +Not everyone will go through this additional effort, +but we make it possible for those who want that extra confidence. +We also provide automatic mechanisms +(such as our use of HTTPS) for those with limited time and +do not want to perform the signature checking on the setup program itself. +Once the correct setup program is running, it will counter other attacks +as described in +. + + + Is Cygwin Setup, or one of the packages, infected with a virus? @@ -197,8 +311,13 @@ disk if you are paranoid. This should be safe, but only if Cygwin Setup is not substituted by -something malicious, and no mirror has been compromised. +something malicious. +See also + +for a description of how the +Cygwin project counters man-in-the-middle (MITM) attacks. + See also for a list of applications that have been known, at one time or another, to interfere with the normal functioning of Cygwin. From 8e01f34ed10291506e395eb57a96231d3bd58d3d Mon Sep 17 00:00:00 2001 From: Takashi Yano Date: Fri, 3 Apr 2015 13:07:35 +0900 Subject: [PATCH 039/109] Cygwin hangs up if several keys are typed during outputting a lot of texts. * fhandler_tty.cc (fhandler_pty_slave::read): Change calculation of "readlen" not to use "bytes_in_pipe" value directly. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/fhandler_tty.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3b0e11187..5ada35de4 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-03 Takashi Yano + + * fhandler_tty.cc (fhandler_pty_slave::read): Change calculation of + "readlen" not to use "bytes_in_pipe" value directly. + 2015-04-02 Jon TURNEY * include/cygwin/signal.h (struct __mcontext): 16-byte align. diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 89cc9e555..daa24ebcc 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -742,7 +742,7 @@ fhandler_pty_slave::read (void *ptr, size_t& len) return; } - readlen = MIN (bytes_in_pipe, MIN (len, sizeof (buf))); + readlen = bytes_in_pipe ? MIN (len, sizeof (buf)) : 0; #if 0 /* Why on earth is the read length reduced to vmin, even if more bytes From 72f7cd89f230342107ec9e22fea38bf75bcb698d Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sat, 4 Apr 2015 23:31:03 +0100 Subject: [PATCH 040/109] Compile exceptions.cc with -fno-omit-frame-pointer on x86 Selectively using -fomit-frame-pointer when -O is used doesn't make sense anymore, apparently since gcc 4.6, -O implies -fomit-frame-pointer. exceptions.cc must be compiled with -fno-omit-frame-pointer on x86, as it uses RtlCaptureContext, which requires a frame pointer. * Makefile.in : Remove setting -fomit-frame-pointer for compiling various files, it is already the default. Set -fno-omit-frame-pointer for exceptions.cc on x86. Signed-off-by: Jon TURNEY --- winsup/cygwin/ChangeLog | 6 ++++ winsup/cygwin/Makefile.in | 59 +++++---------------------------------- 2 files changed, 13 insertions(+), 52 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5ada35de4..a8f4e0053 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2015-04-04 Jon TURNEY + + * Makefile.in : Remove setting -fomit-frame-pointer for compiling + various files, it is already the default. Set + -fno-omit-frame-pointer for exceptions.cc on x86. + 2015-04-03 Takashi Yano * fhandler_tty.cc (fhandler_pty_slave::read): Change calculation of diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index 9b82f0a46..d8277548f 100644 --- a/winsup/cygwin/Makefile.in +++ b/winsup/cygwin/Makefile.in @@ -449,59 +449,14 @@ INSTOBJS:=automode.o binmode.o textmode.o textreadmode.o TARGET_LIBS:=$(LIB_NAME) $(CYGWIN_START) $(GMON_START) $(LIBGMON_A) $(SUBLIBS) $(INSTOBJS) $(EXTRALIBS) ifneq "${filter -O%,$(CFLAGS)}" "" -cygheap_CFLAGS:=-fomit-frame-pointer -cygthread_CFLAGS:=-fomit-frame-pointer -cygtls_CFLAGS:=-fomit-frame-pointer -cygwait_CFLAGS=-fomit-frame-pointer -delqueue_CFLAGS:=-fomit-frame-pointer -devices_CFLAGS:=-fomit-frame-pointer -dir_CFLAGS:=-fomit-frame-pointer -dlfcn_CFLAGS:=-fomit-frame-pointer -dll_init_CFLAGS:=-fomit-frame-pointer -dtable_CFLAGS:=-fomit-frame-pointer -fcheck-new -fcntl_CFLAGS:=-fomit-frame-pointer -fenv_CFLAGS:=-fomit-frame-pointer -fhandler_CFLAGS:=-fomit-frame-pointer -fhandler_clipboard_CFLAGS:=-fomit-frame-pointer -fhandler_console_CFLAGS:=-fomit-frame-pointer -fhandler_disk_file_CFLAGS:=-fomit-frame-pointer -fhandler_dsp_CFLAGS:=-fomit-frame-pointer -fhandler_floppy_CFLAGS:=-fomit-frame-pointer -fhandler_netdrive_CFLAGS:=-fomit-frame-pointer -fhandler_proc_CFLAGS:=-fomit-frame-pointer -fhandler_process_CFLAGS:=-fomit-frame-pointer -fhandler_random_CFLAGS:=-fomit-frame-pointer -fhandler_raw_CFLAGS:=-fomit-frame-pointer -fhandler_registry_CFLAGS:=-fomit-frame-pointer -fhandler_serial_CFLAGS:=-fomit-frame-pointer -fhandler_socket_CFLAGS:=-fomit-frame-pointer -fhandler_syslog_CFLAGS:=-fomit-frame-pointer -fhandler_tape_CFLAGS:=-fomit-frame-pointer -fhandler_termios_CFLAGS:=-fomit-frame-pointer -fhandler_tty_CFLAGS:=-fomit-frame-pointer -fhandler_virtual_CFLAGS:=-fomit-frame-pointer -fhandler_windows_CFLAGS:=-fomit-frame-pointer -fhandler_zero_CFLAGS:=-fomit-frame-pointer -flock_CFLAGS:=-fomit-frame-pointer -grp_CFLAGS:=-fomit-frame-pointer -libstdcxx_wrapper_CFLAGS:=-fomit-frame-pointer +dtable_CFLAGS:=-fcheck-new localtime_CFLAGS:=-fwrapv -malloc_CFLAGS:=-fomit-frame-pointer -O3 -malloc_wrapper_CFLAGS:=-fomit-frame-pointer -miscfuncs_CFLAGS:=-fomit-frame-pointer -net_CFLAGS:=-fomit-frame-pointer -passwd_CFLAGS:=-fomit-frame-pointer -path_CFLAGS=-fomit-frame-pointer -regcomp_CFLAGS=-fomit-frame-pointer -regerror_CFLAGS=-fomit-frame-pointer -regexec_CFLAGS=-fomit-frame-pointer -regfree_CFLAGS=-fomit-frame-pointer -shared_CFLAGS:=-fomit-frame-pointer -sync_CFLAGS:=-fomit-frame-pointer -O3 -smallprint_CFLAGS:=-fomit-frame-pointer -syscalls_CFLAGS:=-fomit-frame-pointer -sysconf_CFLAGS:=-fomit-frame-pointer -uinfo_CFLAGS:=-fomit-frame-pointer +malloc_CFLAGS:=-O3 +sync_CFLAGS:=-O3 +ifeq ($(target_cpu),i686) +# on x86, exceptions.cc must be compiled with a frame-pointer as it uses RtlCaptureContext() +exceptions_CFLAGS:=-fno-omit-frame-pointer +endif endif fhandler_proc_CFLAGS+=-DUSERNAME="\"$(USER)\"" -DHOSTNAME="\"$(HOSTNAME)\"" From de7944034dd37e1f6df91c5457cba00368a86e04 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 7 Apr 2015 12:11:52 +0200 Subject: [PATCH 041/109] Raise # of ptys to 128. * tty.h (NTTYS): Raise to 128. * devices.in: Change pty, ptym, and cons expressions accordingly. * devices.cc: Regenerate. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 6 + winsup/cygwin/devices.cc | 11380 +++++++++++++++++++++------------ winsup/cygwin/devices.in | 6 +- winsup/cygwin/release/1.7.36 | 2 + winsup/cygwin/tty.h | 2 +- 5 files changed, 7283 insertions(+), 4113 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index a8f4e0053..de2dc2379 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2015-04-07 Corinna Vinschen + + * tty.h (NTTYS): Raise to 128. + * devices.in: Change pty, ptym, and cons expressions accordingly. + * devices.cc: Regenerate. + 2015-04-04 Jon TURNEY * Makefile.in : Remove setting -fomit-frame-pointer for compiling diff --git a/winsup/cygwin/devices.cc b/winsup/cygwin/devices.cc index 8aba6d840..fa022ea25 100644 --- a/winsup/cygwin/devices.cc +++ b/winsup/cygwin/devices.cc @@ -225,6 +225,70 @@ const _RDATA device dev_storage[] = {"/dev/cons61", BRACK(FHDEV(DEV_CONS_MAJOR, 61)), "/dev/cons61", exists_console, S_IFCHR, true}, {"/dev/cons62", BRACK(FHDEV(DEV_CONS_MAJOR, 62)), "/dev/cons62", exists_console, S_IFCHR, true}, {"/dev/cons63", BRACK(FHDEV(DEV_CONS_MAJOR, 63)), "/dev/cons63", exists_console, S_IFCHR, true}, + {"/dev/cons64", BRACK(FHDEV(DEV_CONS_MAJOR, 64)), "/dev/cons64", exists_console, S_IFCHR, true}, + {"/dev/cons65", BRACK(FHDEV(DEV_CONS_MAJOR, 65)), "/dev/cons65", exists_console, S_IFCHR, true}, + {"/dev/cons66", BRACK(FHDEV(DEV_CONS_MAJOR, 66)), "/dev/cons66", exists_console, S_IFCHR, true}, + {"/dev/cons67", BRACK(FHDEV(DEV_CONS_MAJOR, 67)), "/dev/cons67", exists_console, S_IFCHR, true}, + {"/dev/cons68", BRACK(FHDEV(DEV_CONS_MAJOR, 68)), "/dev/cons68", exists_console, S_IFCHR, true}, + {"/dev/cons69", BRACK(FHDEV(DEV_CONS_MAJOR, 69)), "/dev/cons69", exists_console, S_IFCHR, true}, + {"/dev/cons70", BRACK(FHDEV(DEV_CONS_MAJOR, 70)), "/dev/cons70", exists_console, S_IFCHR, true}, + {"/dev/cons71", BRACK(FHDEV(DEV_CONS_MAJOR, 71)), "/dev/cons71", exists_console, S_IFCHR, true}, + {"/dev/cons72", BRACK(FHDEV(DEV_CONS_MAJOR, 72)), "/dev/cons72", exists_console, S_IFCHR, true}, + {"/dev/cons73", BRACK(FHDEV(DEV_CONS_MAJOR, 73)), "/dev/cons73", exists_console, S_IFCHR, true}, + {"/dev/cons74", BRACK(FHDEV(DEV_CONS_MAJOR, 74)), "/dev/cons74", exists_console, S_IFCHR, true}, + {"/dev/cons75", BRACK(FHDEV(DEV_CONS_MAJOR, 75)), "/dev/cons75", exists_console, S_IFCHR, true}, + {"/dev/cons76", BRACK(FHDEV(DEV_CONS_MAJOR, 76)), "/dev/cons76", exists_console, S_IFCHR, true}, + {"/dev/cons77", BRACK(FHDEV(DEV_CONS_MAJOR, 77)), "/dev/cons77", exists_console, S_IFCHR, true}, + {"/dev/cons78", BRACK(FHDEV(DEV_CONS_MAJOR, 78)), "/dev/cons78", exists_console, S_IFCHR, true}, + {"/dev/cons79", BRACK(FHDEV(DEV_CONS_MAJOR, 79)), "/dev/cons79", exists_console, S_IFCHR, true}, + {"/dev/cons80", BRACK(FHDEV(DEV_CONS_MAJOR, 80)), "/dev/cons80", exists_console, S_IFCHR, true}, + {"/dev/cons81", BRACK(FHDEV(DEV_CONS_MAJOR, 81)), "/dev/cons81", exists_console, S_IFCHR, true}, + {"/dev/cons82", BRACK(FHDEV(DEV_CONS_MAJOR, 82)), "/dev/cons82", exists_console, S_IFCHR, true}, + {"/dev/cons83", BRACK(FHDEV(DEV_CONS_MAJOR, 83)), "/dev/cons83", exists_console, S_IFCHR, true}, + {"/dev/cons84", BRACK(FHDEV(DEV_CONS_MAJOR, 84)), "/dev/cons84", exists_console, S_IFCHR, true}, + {"/dev/cons85", BRACK(FHDEV(DEV_CONS_MAJOR, 85)), "/dev/cons85", exists_console, S_IFCHR, true}, + {"/dev/cons86", BRACK(FHDEV(DEV_CONS_MAJOR, 86)), "/dev/cons86", exists_console, S_IFCHR, true}, + {"/dev/cons87", BRACK(FHDEV(DEV_CONS_MAJOR, 87)), "/dev/cons87", exists_console, S_IFCHR, true}, + {"/dev/cons88", BRACK(FHDEV(DEV_CONS_MAJOR, 88)), "/dev/cons88", exists_console, S_IFCHR, true}, + {"/dev/cons89", BRACK(FHDEV(DEV_CONS_MAJOR, 89)), "/dev/cons89", exists_console, S_IFCHR, true}, + {"/dev/cons90", BRACK(FHDEV(DEV_CONS_MAJOR, 90)), "/dev/cons90", exists_console, S_IFCHR, true}, + {"/dev/cons91", BRACK(FHDEV(DEV_CONS_MAJOR, 91)), "/dev/cons91", exists_console, S_IFCHR, true}, + {"/dev/cons92", BRACK(FHDEV(DEV_CONS_MAJOR, 92)), "/dev/cons92", exists_console, S_IFCHR, true}, + {"/dev/cons93", BRACK(FHDEV(DEV_CONS_MAJOR, 93)), "/dev/cons93", exists_console, S_IFCHR, true}, + {"/dev/cons94", BRACK(FHDEV(DEV_CONS_MAJOR, 94)), "/dev/cons94", exists_console, S_IFCHR, true}, + {"/dev/cons95", BRACK(FHDEV(DEV_CONS_MAJOR, 95)), "/dev/cons95", exists_console, S_IFCHR, true}, + {"/dev/cons96", BRACK(FHDEV(DEV_CONS_MAJOR, 96)), "/dev/cons96", exists_console, S_IFCHR, true}, + {"/dev/cons97", BRACK(FHDEV(DEV_CONS_MAJOR, 97)), "/dev/cons97", exists_console, S_IFCHR, true}, + {"/dev/cons98", BRACK(FHDEV(DEV_CONS_MAJOR, 98)), "/dev/cons98", exists_console, S_IFCHR, true}, + {"/dev/cons99", BRACK(FHDEV(DEV_CONS_MAJOR, 99)), "/dev/cons99", exists_console, S_IFCHR, true}, + {"/dev/cons100", BRACK(FHDEV(DEV_CONS_MAJOR, 100)), "/dev/cons100", exists_console, S_IFCHR, true}, + {"/dev/cons101", BRACK(FHDEV(DEV_CONS_MAJOR, 101)), "/dev/cons101", exists_console, S_IFCHR, true}, + {"/dev/cons102", BRACK(FHDEV(DEV_CONS_MAJOR, 102)), "/dev/cons102", exists_console, S_IFCHR, true}, + {"/dev/cons103", BRACK(FHDEV(DEV_CONS_MAJOR, 103)), "/dev/cons103", exists_console, S_IFCHR, true}, + {"/dev/cons104", BRACK(FHDEV(DEV_CONS_MAJOR, 104)), "/dev/cons104", exists_console, S_IFCHR, true}, + {"/dev/cons105", BRACK(FHDEV(DEV_CONS_MAJOR, 105)), "/dev/cons105", exists_console, S_IFCHR, true}, + {"/dev/cons106", BRACK(FHDEV(DEV_CONS_MAJOR, 106)), "/dev/cons106", exists_console, S_IFCHR, true}, + {"/dev/cons107", BRACK(FHDEV(DEV_CONS_MAJOR, 107)), "/dev/cons107", exists_console, S_IFCHR, true}, + {"/dev/cons108", BRACK(FHDEV(DEV_CONS_MAJOR, 108)), "/dev/cons108", exists_console, S_IFCHR, true}, + {"/dev/cons109", BRACK(FHDEV(DEV_CONS_MAJOR, 109)), "/dev/cons109", exists_console, S_IFCHR, true}, + {"/dev/cons110", BRACK(FHDEV(DEV_CONS_MAJOR, 110)), "/dev/cons110", exists_console, S_IFCHR, true}, + {"/dev/cons111", BRACK(FHDEV(DEV_CONS_MAJOR, 111)), "/dev/cons111", exists_console, S_IFCHR, true}, + {"/dev/cons112", BRACK(FHDEV(DEV_CONS_MAJOR, 112)), "/dev/cons112", exists_console, S_IFCHR, true}, + {"/dev/cons113", BRACK(FHDEV(DEV_CONS_MAJOR, 113)), "/dev/cons113", exists_console, S_IFCHR, true}, + {"/dev/cons114", BRACK(FHDEV(DEV_CONS_MAJOR, 114)), "/dev/cons114", exists_console, S_IFCHR, true}, + {"/dev/cons115", BRACK(FHDEV(DEV_CONS_MAJOR, 115)), "/dev/cons115", exists_console, S_IFCHR, true}, + {"/dev/cons116", BRACK(FHDEV(DEV_CONS_MAJOR, 116)), "/dev/cons116", exists_console, S_IFCHR, true}, + {"/dev/cons117", BRACK(FHDEV(DEV_CONS_MAJOR, 117)), "/dev/cons117", exists_console, S_IFCHR, true}, + {"/dev/cons118", BRACK(FHDEV(DEV_CONS_MAJOR, 118)), "/dev/cons118", exists_console, S_IFCHR, true}, + {"/dev/cons119", BRACK(FHDEV(DEV_CONS_MAJOR, 119)), "/dev/cons119", exists_console, S_IFCHR, true}, + {"/dev/cons120", BRACK(FHDEV(DEV_CONS_MAJOR, 120)), "/dev/cons120", exists_console, S_IFCHR, true}, + {"/dev/cons121", BRACK(FHDEV(DEV_CONS_MAJOR, 121)), "/dev/cons121", exists_console, S_IFCHR, true}, + {"/dev/cons122", BRACK(FHDEV(DEV_CONS_MAJOR, 122)), "/dev/cons122", exists_console, S_IFCHR, true}, + {"/dev/cons123", BRACK(FHDEV(DEV_CONS_MAJOR, 123)), "/dev/cons123", exists_console, S_IFCHR, true}, + {"/dev/cons124", BRACK(FHDEV(DEV_CONS_MAJOR, 124)), "/dev/cons124", exists_console, S_IFCHR, true}, + {"/dev/cons125", BRACK(FHDEV(DEV_CONS_MAJOR, 125)), "/dev/cons125", exists_console, S_IFCHR, true}, + {"/dev/cons126", BRACK(FHDEV(DEV_CONS_MAJOR, 126)), "/dev/cons126", exists_console, S_IFCHR, true}, + {"/dev/cons127", BRACK(FHDEV(DEV_CONS_MAJOR, 127)), "/dev/cons127", exists_console, S_IFCHR, true}, {"/dev/console", BRACK(FH_CONSOLE), "/dev/console", exists_console, S_IFCHR, true}, {"/dev/dsp", BRACK(FH_OSS_DSP), "\\Device\\Null", exists_ntdev, S_IFCHR, true}, {"/dev/fd0", BRACK(FHDEV(DEV_FLOPPY_MAJOR, 0)), "\\Device\\Floppy0", exists_ntdev, S_IFBLK, true}, @@ -439,6 +503,70 @@ const _RDATA device dev_storage[] = {"/dev/pty61", BRACK(FHDEV(DEV_PTYS_MAJOR, 61)), "/dev/pty61", exists_pty, S_IFCHR, true}, {"/dev/pty62", BRACK(FHDEV(DEV_PTYS_MAJOR, 62)), "/dev/pty62", exists_pty, S_IFCHR, true}, {"/dev/pty63", BRACK(FHDEV(DEV_PTYS_MAJOR, 63)), "/dev/pty63", exists_pty, S_IFCHR, true}, + {"/dev/pty64", BRACK(FHDEV(DEV_PTYS_MAJOR, 64)), "/dev/pty64", exists_pty, S_IFCHR, true}, + {"/dev/pty65", BRACK(FHDEV(DEV_PTYS_MAJOR, 65)), "/dev/pty65", exists_pty, S_IFCHR, true}, + {"/dev/pty66", BRACK(FHDEV(DEV_PTYS_MAJOR, 66)), "/dev/pty66", exists_pty, S_IFCHR, true}, + {"/dev/pty67", BRACK(FHDEV(DEV_PTYS_MAJOR, 67)), "/dev/pty67", exists_pty, S_IFCHR, true}, + {"/dev/pty68", BRACK(FHDEV(DEV_PTYS_MAJOR, 68)), "/dev/pty68", exists_pty, S_IFCHR, true}, + {"/dev/pty69", BRACK(FHDEV(DEV_PTYS_MAJOR, 69)), "/dev/pty69", exists_pty, S_IFCHR, true}, + {"/dev/pty70", BRACK(FHDEV(DEV_PTYS_MAJOR, 70)), "/dev/pty70", exists_pty, S_IFCHR, true}, + {"/dev/pty71", BRACK(FHDEV(DEV_PTYS_MAJOR, 71)), "/dev/pty71", exists_pty, S_IFCHR, true}, + {"/dev/pty72", BRACK(FHDEV(DEV_PTYS_MAJOR, 72)), "/dev/pty72", exists_pty, S_IFCHR, true}, + {"/dev/pty73", BRACK(FHDEV(DEV_PTYS_MAJOR, 73)), "/dev/pty73", exists_pty, S_IFCHR, true}, + {"/dev/pty74", BRACK(FHDEV(DEV_PTYS_MAJOR, 74)), "/dev/pty74", exists_pty, S_IFCHR, true}, + {"/dev/pty75", BRACK(FHDEV(DEV_PTYS_MAJOR, 75)), "/dev/pty75", exists_pty, S_IFCHR, true}, + {"/dev/pty76", BRACK(FHDEV(DEV_PTYS_MAJOR, 76)), "/dev/pty76", exists_pty, S_IFCHR, true}, + {"/dev/pty77", BRACK(FHDEV(DEV_PTYS_MAJOR, 77)), "/dev/pty77", exists_pty, S_IFCHR, true}, + {"/dev/pty78", BRACK(FHDEV(DEV_PTYS_MAJOR, 78)), "/dev/pty78", exists_pty, S_IFCHR, true}, + {"/dev/pty79", BRACK(FHDEV(DEV_PTYS_MAJOR, 79)), "/dev/pty79", exists_pty, S_IFCHR, true}, + {"/dev/pty80", BRACK(FHDEV(DEV_PTYS_MAJOR, 80)), "/dev/pty80", exists_pty, S_IFCHR, true}, + {"/dev/pty81", BRACK(FHDEV(DEV_PTYS_MAJOR, 81)), "/dev/pty81", exists_pty, S_IFCHR, true}, + {"/dev/pty82", BRACK(FHDEV(DEV_PTYS_MAJOR, 82)), "/dev/pty82", exists_pty, S_IFCHR, true}, + {"/dev/pty83", BRACK(FHDEV(DEV_PTYS_MAJOR, 83)), "/dev/pty83", exists_pty, S_IFCHR, true}, + {"/dev/pty84", BRACK(FHDEV(DEV_PTYS_MAJOR, 84)), "/dev/pty84", exists_pty, S_IFCHR, true}, + {"/dev/pty85", BRACK(FHDEV(DEV_PTYS_MAJOR, 85)), "/dev/pty85", exists_pty, S_IFCHR, true}, + {"/dev/pty86", BRACK(FHDEV(DEV_PTYS_MAJOR, 86)), "/dev/pty86", exists_pty, S_IFCHR, true}, + {"/dev/pty87", BRACK(FHDEV(DEV_PTYS_MAJOR, 87)), "/dev/pty87", exists_pty, S_IFCHR, true}, + {"/dev/pty88", BRACK(FHDEV(DEV_PTYS_MAJOR, 88)), "/dev/pty88", exists_pty, S_IFCHR, true}, + {"/dev/pty89", BRACK(FHDEV(DEV_PTYS_MAJOR, 89)), "/dev/pty89", exists_pty, S_IFCHR, true}, + {"/dev/pty90", BRACK(FHDEV(DEV_PTYS_MAJOR, 90)), "/dev/pty90", exists_pty, S_IFCHR, true}, + {"/dev/pty91", BRACK(FHDEV(DEV_PTYS_MAJOR, 91)), "/dev/pty91", exists_pty, S_IFCHR, true}, + {"/dev/pty92", BRACK(FHDEV(DEV_PTYS_MAJOR, 92)), "/dev/pty92", exists_pty, S_IFCHR, true}, + {"/dev/pty93", BRACK(FHDEV(DEV_PTYS_MAJOR, 93)), "/dev/pty93", exists_pty, S_IFCHR, true}, + {"/dev/pty94", BRACK(FHDEV(DEV_PTYS_MAJOR, 94)), "/dev/pty94", exists_pty, S_IFCHR, true}, + {"/dev/pty95", BRACK(FHDEV(DEV_PTYS_MAJOR, 95)), "/dev/pty95", exists_pty, S_IFCHR, true}, + {"/dev/pty96", BRACK(FHDEV(DEV_PTYS_MAJOR, 96)), "/dev/pty96", exists_pty, S_IFCHR, true}, + {"/dev/pty97", BRACK(FHDEV(DEV_PTYS_MAJOR, 97)), "/dev/pty97", exists_pty, S_IFCHR, true}, + {"/dev/pty98", BRACK(FHDEV(DEV_PTYS_MAJOR, 98)), "/dev/pty98", exists_pty, S_IFCHR, true}, + {"/dev/pty99", BRACK(FHDEV(DEV_PTYS_MAJOR, 99)), "/dev/pty99", exists_pty, S_IFCHR, true}, + {"/dev/pty100", BRACK(FHDEV(DEV_PTYS_MAJOR, 100)), "/dev/pty100", exists_pty, S_IFCHR, true}, + {"/dev/pty101", BRACK(FHDEV(DEV_PTYS_MAJOR, 101)), "/dev/pty101", exists_pty, S_IFCHR, true}, + {"/dev/pty102", BRACK(FHDEV(DEV_PTYS_MAJOR, 102)), "/dev/pty102", exists_pty, S_IFCHR, true}, + {"/dev/pty103", BRACK(FHDEV(DEV_PTYS_MAJOR, 103)), "/dev/pty103", exists_pty, S_IFCHR, true}, + {"/dev/pty104", BRACK(FHDEV(DEV_PTYS_MAJOR, 104)), "/dev/pty104", exists_pty, S_IFCHR, true}, + {"/dev/pty105", BRACK(FHDEV(DEV_PTYS_MAJOR, 105)), "/dev/pty105", exists_pty, S_IFCHR, true}, + {"/dev/pty106", BRACK(FHDEV(DEV_PTYS_MAJOR, 106)), "/dev/pty106", exists_pty, S_IFCHR, true}, + {"/dev/pty107", BRACK(FHDEV(DEV_PTYS_MAJOR, 107)), "/dev/pty107", exists_pty, S_IFCHR, true}, + {"/dev/pty108", BRACK(FHDEV(DEV_PTYS_MAJOR, 108)), "/dev/pty108", exists_pty, S_IFCHR, true}, + {"/dev/pty109", BRACK(FHDEV(DEV_PTYS_MAJOR, 109)), "/dev/pty109", exists_pty, S_IFCHR, true}, + {"/dev/pty110", BRACK(FHDEV(DEV_PTYS_MAJOR, 110)), "/dev/pty110", exists_pty, S_IFCHR, true}, + {"/dev/pty111", BRACK(FHDEV(DEV_PTYS_MAJOR, 111)), "/dev/pty111", exists_pty, S_IFCHR, true}, + {"/dev/pty112", BRACK(FHDEV(DEV_PTYS_MAJOR, 112)), "/dev/pty112", exists_pty, S_IFCHR, true}, + {"/dev/pty113", BRACK(FHDEV(DEV_PTYS_MAJOR, 113)), "/dev/pty113", exists_pty, S_IFCHR, true}, + {"/dev/pty114", BRACK(FHDEV(DEV_PTYS_MAJOR, 114)), "/dev/pty114", exists_pty, S_IFCHR, true}, + {"/dev/pty115", BRACK(FHDEV(DEV_PTYS_MAJOR, 115)), "/dev/pty115", exists_pty, S_IFCHR, true}, + {"/dev/pty116", BRACK(FHDEV(DEV_PTYS_MAJOR, 116)), "/dev/pty116", exists_pty, S_IFCHR, true}, + {"/dev/pty117", BRACK(FHDEV(DEV_PTYS_MAJOR, 117)), "/dev/pty117", exists_pty, S_IFCHR, true}, + {"/dev/pty118", BRACK(FHDEV(DEV_PTYS_MAJOR, 118)), "/dev/pty118", exists_pty, S_IFCHR, true}, + {"/dev/pty119", BRACK(FHDEV(DEV_PTYS_MAJOR, 119)), "/dev/pty119", exists_pty, S_IFCHR, true}, + {"/dev/pty120", BRACK(FHDEV(DEV_PTYS_MAJOR, 120)), "/dev/pty120", exists_pty, S_IFCHR, true}, + {"/dev/pty121", BRACK(FHDEV(DEV_PTYS_MAJOR, 121)), "/dev/pty121", exists_pty, S_IFCHR, true}, + {"/dev/pty122", BRACK(FHDEV(DEV_PTYS_MAJOR, 122)), "/dev/pty122", exists_pty, S_IFCHR, true}, + {"/dev/pty123", BRACK(FHDEV(DEV_PTYS_MAJOR, 123)), "/dev/pty123", exists_pty, S_IFCHR, true}, + {"/dev/pty124", BRACK(FHDEV(DEV_PTYS_MAJOR, 124)), "/dev/pty124", exists_pty, S_IFCHR, true}, + {"/dev/pty125", BRACK(FHDEV(DEV_PTYS_MAJOR, 125)), "/dev/pty125", exists_pty, S_IFCHR, true}, + {"/dev/pty126", BRACK(FHDEV(DEV_PTYS_MAJOR, 126)), "/dev/pty126", exists_pty, S_IFCHR, true}, + {"/dev/pty127", BRACK(FHDEV(DEV_PTYS_MAJOR, 127)), "/dev/pty127", exists_pty, S_IFCHR, true}, {"/dev/random", BRACK(FH_RANDOM), "\\Device\\Null", exists_ntdev, S_IFCHR, true}, {"/dev/scd0", BRACK(FHDEV(DEV_CDROM_MAJOR, 0)), "\\Device\\CdRom0", exists_ntdev, S_IFBLK, true}, {"/dev/scd1", BRACK(FHDEV(DEV_CDROM_MAJOR, 1)), "\\Device\\CdRom1", exists_ntdev, S_IFBLK, true}, @@ -2781,14 +2909,78 @@ const _RDATA device dev_storage[] = {":ptym60", BRACK(FHDEV(DEV_PTYM_MAJOR, 60)), "/dev/ptym60", exists_internal, S_IFCHR, false}, {":ptym61", BRACK(FHDEV(DEV_PTYM_MAJOR, 61)), "/dev/ptym61", exists_internal, S_IFCHR, false}, {":ptym62", BRACK(FHDEV(DEV_PTYM_MAJOR, 62)), "/dev/ptym62", exists_internal, S_IFCHR, false}, - {":ptym63", BRACK(FHDEV(DEV_PTYM_MAJOR, 63)), "/dev/ptym63", exists_internal, S_IFCHR, false} + {":ptym63", BRACK(FHDEV(DEV_PTYM_MAJOR, 63)), "/dev/ptym63", exists_internal, S_IFCHR, false}, + {":ptym64", BRACK(FHDEV(DEV_PTYM_MAJOR, 64)), "/dev/ptym64", exists_internal, S_IFCHR, false}, + {":ptym65", BRACK(FHDEV(DEV_PTYM_MAJOR, 65)), "/dev/ptym65", exists_internal, S_IFCHR, false}, + {":ptym66", BRACK(FHDEV(DEV_PTYM_MAJOR, 66)), "/dev/ptym66", exists_internal, S_IFCHR, false}, + {":ptym67", BRACK(FHDEV(DEV_PTYM_MAJOR, 67)), "/dev/ptym67", exists_internal, S_IFCHR, false}, + {":ptym68", BRACK(FHDEV(DEV_PTYM_MAJOR, 68)), "/dev/ptym68", exists_internal, S_IFCHR, false}, + {":ptym69", BRACK(FHDEV(DEV_PTYM_MAJOR, 69)), "/dev/ptym69", exists_internal, S_IFCHR, false}, + {":ptym70", BRACK(FHDEV(DEV_PTYM_MAJOR, 70)), "/dev/ptym70", exists_internal, S_IFCHR, false}, + {":ptym71", BRACK(FHDEV(DEV_PTYM_MAJOR, 71)), "/dev/ptym71", exists_internal, S_IFCHR, false}, + {":ptym72", BRACK(FHDEV(DEV_PTYM_MAJOR, 72)), "/dev/ptym72", exists_internal, S_IFCHR, false}, + {":ptym73", BRACK(FHDEV(DEV_PTYM_MAJOR, 73)), "/dev/ptym73", exists_internal, S_IFCHR, false}, + {":ptym74", BRACK(FHDEV(DEV_PTYM_MAJOR, 74)), "/dev/ptym74", exists_internal, S_IFCHR, false}, + {":ptym75", BRACK(FHDEV(DEV_PTYM_MAJOR, 75)), "/dev/ptym75", exists_internal, S_IFCHR, false}, + {":ptym76", BRACK(FHDEV(DEV_PTYM_MAJOR, 76)), "/dev/ptym76", exists_internal, S_IFCHR, false}, + {":ptym77", BRACK(FHDEV(DEV_PTYM_MAJOR, 77)), "/dev/ptym77", exists_internal, S_IFCHR, false}, + {":ptym78", BRACK(FHDEV(DEV_PTYM_MAJOR, 78)), "/dev/ptym78", exists_internal, S_IFCHR, false}, + {":ptym79", BRACK(FHDEV(DEV_PTYM_MAJOR, 79)), "/dev/ptym79", exists_internal, S_IFCHR, false}, + {":ptym80", BRACK(FHDEV(DEV_PTYM_MAJOR, 80)), "/dev/ptym80", exists_internal, S_IFCHR, false}, + {":ptym81", BRACK(FHDEV(DEV_PTYM_MAJOR, 81)), "/dev/ptym81", exists_internal, S_IFCHR, false}, + {":ptym82", BRACK(FHDEV(DEV_PTYM_MAJOR, 82)), "/dev/ptym82", exists_internal, S_IFCHR, false}, + {":ptym83", BRACK(FHDEV(DEV_PTYM_MAJOR, 83)), "/dev/ptym83", exists_internal, S_IFCHR, false}, + {":ptym84", BRACK(FHDEV(DEV_PTYM_MAJOR, 84)), "/dev/ptym84", exists_internal, S_IFCHR, false}, + {":ptym85", BRACK(FHDEV(DEV_PTYM_MAJOR, 85)), "/dev/ptym85", exists_internal, S_IFCHR, false}, + {":ptym86", BRACK(FHDEV(DEV_PTYM_MAJOR, 86)), "/dev/ptym86", exists_internal, S_IFCHR, false}, + {":ptym87", BRACK(FHDEV(DEV_PTYM_MAJOR, 87)), "/dev/ptym87", exists_internal, S_IFCHR, false}, + {":ptym88", BRACK(FHDEV(DEV_PTYM_MAJOR, 88)), "/dev/ptym88", exists_internal, S_IFCHR, false}, + {":ptym89", BRACK(FHDEV(DEV_PTYM_MAJOR, 89)), "/dev/ptym89", exists_internal, S_IFCHR, false}, + {":ptym90", BRACK(FHDEV(DEV_PTYM_MAJOR, 90)), "/dev/ptym90", exists_internal, S_IFCHR, false}, + {":ptym91", BRACK(FHDEV(DEV_PTYM_MAJOR, 91)), "/dev/ptym91", exists_internal, S_IFCHR, false}, + {":ptym92", BRACK(FHDEV(DEV_PTYM_MAJOR, 92)), "/dev/ptym92", exists_internal, S_IFCHR, false}, + {":ptym93", BRACK(FHDEV(DEV_PTYM_MAJOR, 93)), "/dev/ptym93", exists_internal, S_IFCHR, false}, + {":ptym94", BRACK(FHDEV(DEV_PTYM_MAJOR, 94)), "/dev/ptym94", exists_internal, S_IFCHR, false}, + {":ptym95", BRACK(FHDEV(DEV_PTYM_MAJOR, 95)), "/dev/ptym95", exists_internal, S_IFCHR, false}, + {":ptym96", BRACK(FHDEV(DEV_PTYM_MAJOR, 96)), "/dev/ptym96", exists_internal, S_IFCHR, false}, + {":ptym97", BRACK(FHDEV(DEV_PTYM_MAJOR, 97)), "/dev/ptym97", exists_internal, S_IFCHR, false}, + {":ptym98", BRACK(FHDEV(DEV_PTYM_MAJOR, 98)), "/dev/ptym98", exists_internal, S_IFCHR, false}, + {":ptym99", BRACK(FHDEV(DEV_PTYM_MAJOR, 99)), "/dev/ptym99", exists_internal, S_IFCHR, false}, + {":ptym100", BRACK(FHDEV(DEV_PTYM_MAJOR, 100)), "/dev/ptym100", exists_internal, S_IFCHR, false}, + {":ptym101", BRACK(FHDEV(DEV_PTYM_MAJOR, 101)), "/dev/ptym101", exists_internal, S_IFCHR, false}, + {":ptym102", BRACK(FHDEV(DEV_PTYM_MAJOR, 102)), "/dev/ptym102", exists_internal, S_IFCHR, false}, + {":ptym103", BRACK(FHDEV(DEV_PTYM_MAJOR, 103)), "/dev/ptym103", exists_internal, S_IFCHR, false}, + {":ptym104", BRACK(FHDEV(DEV_PTYM_MAJOR, 104)), "/dev/ptym104", exists_internal, S_IFCHR, false}, + {":ptym105", BRACK(FHDEV(DEV_PTYM_MAJOR, 105)), "/dev/ptym105", exists_internal, S_IFCHR, false}, + {":ptym106", BRACK(FHDEV(DEV_PTYM_MAJOR, 106)), "/dev/ptym106", exists_internal, S_IFCHR, false}, + {":ptym107", BRACK(FHDEV(DEV_PTYM_MAJOR, 107)), "/dev/ptym107", exists_internal, S_IFCHR, false}, + {":ptym108", BRACK(FHDEV(DEV_PTYM_MAJOR, 108)), "/dev/ptym108", exists_internal, S_IFCHR, false}, + {":ptym109", BRACK(FHDEV(DEV_PTYM_MAJOR, 109)), "/dev/ptym109", exists_internal, S_IFCHR, false}, + {":ptym110", BRACK(FHDEV(DEV_PTYM_MAJOR, 110)), "/dev/ptym110", exists_internal, S_IFCHR, false}, + {":ptym111", BRACK(FHDEV(DEV_PTYM_MAJOR, 111)), "/dev/ptym111", exists_internal, S_IFCHR, false}, + {":ptym112", BRACK(FHDEV(DEV_PTYM_MAJOR, 112)), "/dev/ptym112", exists_internal, S_IFCHR, false}, + {":ptym113", BRACK(FHDEV(DEV_PTYM_MAJOR, 113)), "/dev/ptym113", exists_internal, S_IFCHR, false}, + {":ptym114", BRACK(FHDEV(DEV_PTYM_MAJOR, 114)), "/dev/ptym114", exists_internal, S_IFCHR, false}, + {":ptym115", BRACK(FHDEV(DEV_PTYM_MAJOR, 115)), "/dev/ptym115", exists_internal, S_IFCHR, false}, + {":ptym116", BRACK(FHDEV(DEV_PTYM_MAJOR, 116)), "/dev/ptym116", exists_internal, S_IFCHR, false}, + {":ptym117", BRACK(FHDEV(DEV_PTYM_MAJOR, 117)), "/dev/ptym117", exists_internal, S_IFCHR, false}, + {":ptym118", BRACK(FHDEV(DEV_PTYM_MAJOR, 118)), "/dev/ptym118", exists_internal, S_IFCHR, false}, + {":ptym119", BRACK(FHDEV(DEV_PTYM_MAJOR, 119)), "/dev/ptym119", exists_internal, S_IFCHR, false}, + {":ptym120", BRACK(FHDEV(DEV_PTYM_MAJOR, 120)), "/dev/ptym120", exists_internal, S_IFCHR, false}, + {":ptym121", BRACK(FHDEV(DEV_PTYM_MAJOR, 121)), "/dev/ptym121", exists_internal, S_IFCHR, false}, + {":ptym122", BRACK(FHDEV(DEV_PTYM_MAJOR, 122)), "/dev/ptym122", exists_internal, S_IFCHR, false}, + {":ptym123", BRACK(FHDEV(DEV_PTYM_MAJOR, 123)), "/dev/ptym123", exists_internal, S_IFCHR, false}, + {":ptym124", BRACK(FHDEV(DEV_PTYM_MAJOR, 124)), "/dev/ptym124", exists_internal, S_IFCHR, false}, + {":ptym125", BRACK(FHDEV(DEV_PTYM_MAJOR, 125)), "/dev/ptym125", exists_internal, S_IFCHR, false}, + {":ptym126", BRACK(FHDEV(DEV_PTYM_MAJOR, 126)), "/dev/ptym126", exists_internal, S_IFCHR, false}, + {":ptym127", BRACK(FHDEV(DEV_PTYM_MAJOR, 127)), "/dev/ptym127", exists_internal, S_IFCHR, false} }; const device *cons_dev = dev_storage + 20; -const device *console_dev = dev_storage + 84; -const device *ptym_dev = dev_storage + 2577; -const device *ptys_dev = dev_storage + 234; -const device *urandom_dev = dev_storage + 2572; +const device *console_dev = dev_storage + 148; +const device *ptym_dev = dev_storage + 2705; +const device *ptys_dev = dev_storage + 298; +const device *urandom_dev = dev_storage + 2700; static KR_device_t KR_find_keyword (const char *KR_keyword, int KR_length) @@ -2818,7 +3010,7 @@ return NULL; if (strncmp (KR_keyword, ":pipe", 5) == 0) { { -return dev_storage + 2576; +return dev_storage + 2704; } } @@ -2833,7 +3025,7 @@ return NULL; if (strncmp (KR_keyword, ":fifo", 5) == 0) { { -return dev_storage + 2575; +return dev_storage + 2703; } } @@ -2857,7 +3049,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym9", 6) == 0) { { -return dev_storage + 2586; +return dev_storage + 2714; } } @@ -2872,7 +3064,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym8", 6) == 0) { { -return dev_storage + 2585; +return dev_storage + 2713; } } @@ -2887,7 +3079,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym7", 6) == 0) { { -return dev_storage + 2584; +return dev_storage + 2712; } } @@ -2902,7 +3094,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym6", 6) == 0) { { -return dev_storage + 2583; +return dev_storage + 2711; } } @@ -2917,7 +3109,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym5", 6) == 0) { { -return dev_storage + 2582; +return dev_storage + 2710; } } @@ -2932,7 +3124,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym4", 6) == 0) { { -return dev_storage + 2581; +return dev_storage + 2709; } } @@ -2947,7 +3139,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym3", 6) == 0) { { -return dev_storage + 2580; +return dev_storage + 2708; } } @@ -2962,7 +3154,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym2", 6) == 0) { { -return dev_storage + 2579; +return dev_storage + 2707; } } @@ -2977,7 +3169,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym1", 6) == 0) { { -return dev_storage + 2578; +return dev_storage + 2706; } } @@ -2992,7 +3184,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym0", 6) == 0) { { -return dev_storage + 2577; +return dev_storage + 2705; } } @@ -3012,14 +3204,581 @@ return NULL; case 7: switch (KR_keyword [5]) { + case '9': + switch (KR_keyword [6]) + { + case '9': + if (strncmp (KR_keyword, ":ptym99", 7) == 0) + { +{ +return dev_storage + 2804; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, ":ptym98", 7) == 0) + { +{ +return dev_storage + 2803; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, ":ptym97", 7) == 0) + { +{ +return dev_storage + 2802; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, ":ptym96", 7) == 0) + { +{ +return dev_storage + 2801; + +} + } + else + { +{ +return NULL; + +} + } + case '5': + if (strncmp (KR_keyword, ":ptym95", 7) == 0) + { +{ +return dev_storage + 2800; + +} + } + else + { +{ +return NULL; + +} + } + case '4': + if (strncmp (KR_keyword, ":ptym94", 7) == 0) + { +{ +return dev_storage + 2799; + +} + } + else + { +{ +return NULL; + +} + } + case '3': + if (strncmp (KR_keyword, ":ptym93", 7) == 0) + { +{ +return dev_storage + 2798; + +} + } + else + { +{ +return NULL; + +} + } + case '2': + if (strncmp (KR_keyword, ":ptym92", 7) == 0) + { +{ +return dev_storage + 2797; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, ":ptym91", 7) == 0) + { +{ +return dev_storage + 2796; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, ":ptym90", 7) == 0) + { +{ +return dev_storage + 2795; + +} + } + else + { +{ +return NULL; + +} + } + default: +{ +return NULL; + +} + } + case '8': + switch (KR_keyword [6]) + { + case '9': + if (strncmp (KR_keyword, ":ptym89", 7) == 0) + { +{ +return dev_storage + 2794; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, ":ptym88", 7) == 0) + { +{ +return dev_storage + 2793; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, ":ptym87", 7) == 0) + { +{ +return dev_storage + 2792; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, ":ptym86", 7) == 0) + { +{ +return dev_storage + 2791; + +} + } + else + { +{ +return NULL; + +} + } + case '5': + if (strncmp (KR_keyword, ":ptym85", 7) == 0) + { +{ +return dev_storage + 2790; + +} + } + else + { +{ +return NULL; + +} + } + case '4': + if (strncmp (KR_keyword, ":ptym84", 7) == 0) + { +{ +return dev_storage + 2789; + +} + } + else + { +{ +return NULL; + +} + } + case '3': + if (strncmp (KR_keyword, ":ptym83", 7) == 0) + { +{ +return dev_storage + 2788; + +} + } + else + { +{ +return NULL; + +} + } + case '2': + if (strncmp (KR_keyword, ":ptym82", 7) == 0) + { +{ +return dev_storage + 2787; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, ":ptym81", 7) == 0) + { +{ +return dev_storage + 2786; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, ":ptym80", 7) == 0) + { +{ +return dev_storage + 2785; + +} + } + else + { +{ +return NULL; + +} + } + default: +{ +return NULL; + +} + } + case '7': + switch (KR_keyword [6]) + { + case '9': + if (strncmp (KR_keyword, ":ptym79", 7) == 0) + { +{ +return dev_storage + 2784; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, ":ptym78", 7) == 0) + { +{ +return dev_storage + 2783; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, ":ptym77", 7) == 0) + { +{ +return dev_storage + 2782; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, ":ptym76", 7) == 0) + { +{ +return dev_storage + 2781; + +} + } + else + { +{ +return NULL; + +} + } + case '5': + if (strncmp (KR_keyword, ":ptym75", 7) == 0) + { +{ +return dev_storage + 2780; + +} + } + else + { +{ +return NULL; + +} + } + case '4': + if (strncmp (KR_keyword, ":ptym74", 7) == 0) + { +{ +return dev_storage + 2779; + +} + } + else + { +{ +return NULL; + +} + } + case '3': + if (strncmp (KR_keyword, ":ptym73", 7) == 0) + { +{ +return dev_storage + 2778; + +} + } + else + { +{ +return NULL; + +} + } + case '2': + if (strncmp (KR_keyword, ":ptym72", 7) == 0) + { +{ +return dev_storage + 2777; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, ":ptym71", 7) == 0) + { +{ +return dev_storage + 2776; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, ":ptym70", 7) == 0) + { +{ +return dev_storage + 2775; + +} + } + else + { +{ +return NULL; + +} + } + default: +{ +return NULL; + +} + } case '6': switch (KR_keyword [6]) { + case '9': + if (strncmp (KR_keyword, ":ptym69", 7) == 0) + { +{ +return dev_storage + 2774; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, ":ptym68", 7) == 0) + { +{ +return dev_storage + 2773; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, ":ptym67", 7) == 0) + { +{ +return dev_storage + 2772; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, ":ptym66", 7) == 0) + { +{ +return dev_storage + 2771; + +} + } + else + { +{ +return NULL; + +} + } + case '5': + if (strncmp (KR_keyword, ":ptym65", 7) == 0) + { +{ +return dev_storage + 2770; + +} + } + else + { +{ +return NULL; + +} + } + case '4': + if (strncmp (KR_keyword, ":ptym64", 7) == 0) + { +{ +return dev_storage + 2769; + +} + } + else + { +{ +return NULL; + +} + } case '3': if (strncmp (KR_keyword, ":ptym63", 7) == 0) { { -return dev_storage + 2640; +return dev_storage + 2768; } } @@ -3034,7 +3793,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym62", 7) == 0) { { -return dev_storage + 2639; +return dev_storage + 2767; } } @@ -3049,7 +3808,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym61", 7) == 0) { { -return dev_storage + 2638; +return dev_storage + 2766; } } @@ -3064,7 +3823,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym60", 7) == 0) { { -return dev_storage + 2637; +return dev_storage + 2765; } } @@ -3088,7 +3847,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym59", 7) == 0) { { -return dev_storage + 2636; +return dev_storage + 2764; } } @@ -3103,7 +3862,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym58", 7) == 0) { { -return dev_storage + 2635; +return dev_storage + 2763; } } @@ -3118,7 +3877,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym57", 7) == 0) { { -return dev_storage + 2634; +return dev_storage + 2762; } } @@ -3133,7 +3892,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym56", 7) == 0) { { -return dev_storage + 2633; +return dev_storage + 2761; } } @@ -3148,7 +3907,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym55", 7) == 0) { { -return dev_storage + 2632; +return dev_storage + 2760; } } @@ -3163,7 +3922,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym54", 7) == 0) { { -return dev_storage + 2631; +return dev_storage + 2759; } } @@ -3178,7 +3937,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym53", 7) == 0) { { -return dev_storage + 2630; +return dev_storage + 2758; } } @@ -3193,7 +3952,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym52", 7) == 0) { { -return dev_storage + 2629; +return dev_storage + 2757; } } @@ -3208,7 +3967,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym51", 7) == 0) { { -return dev_storage + 2628; +return dev_storage + 2756; } } @@ -3223,7 +3982,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym50", 7) == 0) { { -return dev_storage + 2627; +return dev_storage + 2755; } } @@ -3247,7 +4006,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym49", 7) == 0) { { -return dev_storage + 2626; +return dev_storage + 2754; } } @@ -3262,7 +4021,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym48", 7) == 0) { { -return dev_storage + 2625; +return dev_storage + 2753; } } @@ -3277,7 +4036,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym47", 7) == 0) { { -return dev_storage + 2624; +return dev_storage + 2752; } } @@ -3292,7 +4051,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym46", 7) == 0) { { -return dev_storage + 2623; +return dev_storage + 2751; } } @@ -3307,7 +4066,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym45", 7) == 0) { { -return dev_storage + 2622; +return dev_storage + 2750; } } @@ -3322,7 +4081,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym44", 7) == 0) { { -return dev_storage + 2621; +return dev_storage + 2749; } } @@ -3337,7 +4096,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym43", 7) == 0) { { -return dev_storage + 2620; +return dev_storage + 2748; } } @@ -3352,7 +4111,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym42", 7) == 0) { { -return dev_storage + 2619; +return dev_storage + 2747; } } @@ -3367,7 +4126,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym41", 7) == 0) { { -return dev_storage + 2618; +return dev_storage + 2746; } } @@ -3382,7 +4141,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym40", 7) == 0) { { -return dev_storage + 2617; +return dev_storage + 2745; } } @@ -3406,7 +4165,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym39", 7) == 0) { { -return dev_storage + 2616; +return dev_storage + 2744; } } @@ -3421,7 +4180,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym38", 7) == 0) { { -return dev_storage + 2615; +return dev_storage + 2743; } } @@ -3436,7 +4195,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym37", 7) == 0) { { -return dev_storage + 2614; +return dev_storage + 2742; } } @@ -3451,7 +4210,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym36", 7) == 0) { { -return dev_storage + 2613; +return dev_storage + 2741; } } @@ -3466,7 +4225,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym35", 7) == 0) { { -return dev_storage + 2612; +return dev_storage + 2740; } } @@ -3481,7 +4240,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym34", 7) == 0) { { -return dev_storage + 2611; +return dev_storage + 2739; } } @@ -3496,7 +4255,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym33", 7) == 0) { { -return dev_storage + 2610; +return dev_storage + 2738; } } @@ -3511,7 +4270,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym32", 7) == 0) { { -return dev_storage + 2609; +return dev_storage + 2737; } } @@ -3526,7 +4285,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym31", 7) == 0) { { -return dev_storage + 2608; +return dev_storage + 2736; } } @@ -3541,7 +4300,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym30", 7) == 0) { { -return dev_storage + 2607; +return dev_storage + 2735; } } @@ -3565,7 +4324,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym29", 7) == 0) { { -return dev_storage + 2606; +return dev_storage + 2734; } } @@ -3580,7 +4339,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym28", 7) == 0) { { -return dev_storage + 2605; +return dev_storage + 2733; } } @@ -3595,7 +4354,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym27", 7) == 0) { { -return dev_storage + 2604; +return dev_storage + 2732; } } @@ -3610,7 +4369,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym26", 7) == 0) { { -return dev_storage + 2603; +return dev_storage + 2731; } } @@ -3625,7 +4384,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym25", 7) == 0) { { -return dev_storage + 2602; +return dev_storage + 2730; } } @@ -3640,7 +4399,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym24", 7) == 0) { { -return dev_storage + 2601; +return dev_storage + 2729; } } @@ -3655,7 +4414,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym23", 7) == 0) { { -return dev_storage + 2600; +return dev_storage + 2728; } } @@ -3670,7 +4429,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym22", 7) == 0) { { -return dev_storage + 2599; +return dev_storage + 2727; } } @@ -3685,7 +4444,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym21", 7) == 0) { { -return dev_storage + 2598; +return dev_storage + 2726; } } @@ -3700,7 +4459,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym20", 7) == 0) { { -return dev_storage + 2597; +return dev_storage + 2725; } } @@ -3724,7 +4483,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym19", 7) == 0) { { -return dev_storage + 2596; +return dev_storage + 2724; } } @@ -3739,7 +4498,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym18", 7) == 0) { { -return dev_storage + 2595; +return dev_storage + 2723; } } @@ -3754,7 +4513,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym17", 7) == 0) { { -return dev_storage + 2594; +return dev_storage + 2722; } } @@ -3769,7 +4528,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym16", 7) == 0) { { -return dev_storage + 2593; +return dev_storage + 2721; } } @@ -3784,7 +4543,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym15", 7) == 0) { { -return dev_storage + 2592; +return dev_storage + 2720; } } @@ -3799,7 +4558,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym14", 7) == 0) { { -return dev_storage + 2591; +return dev_storage + 2719; } } @@ -3814,7 +4573,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym13", 7) == 0) { { -return dev_storage + 2590; +return dev_storage + 2718; } } @@ -3829,7 +4588,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym12", 7) == 0) { { -return dev_storage + 2589; +return dev_storage + 2717; } } @@ -3844,7 +4603,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym11", 7) == 0) { { -return dev_storage + 2588; +return dev_storage + 2716; } } @@ -3859,7 +4618,7 @@ return NULL; if (strncmp (KR_keyword, ":ptym10", 7) == 0) { { -return dev_storage + 2587; +return dev_storage + 2715; } } @@ -3889,7 +4648,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz", 8) == 0) { { -return dev_storage + 340; +return dev_storage + 468; } } @@ -3907,7 +4666,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/tty", 8) == 0) { { -return dev_storage + 2507; +return dev_storage + 2635; } } @@ -3922,7 +4681,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy", 8) == 0) { { -return dev_storage + 339; +return dev_storage + 467; } } @@ -3943,7 +4702,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx", 8) == 0) { { -return dev_storage + 338; +return dev_storage + 466; } } @@ -3958,7 +4717,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw", 8) == 0) { { -return dev_storage + 337; +return dev_storage + 465; } } @@ -3973,7 +4732,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv", 8) == 0) { { -return dev_storage + 336; +return dev_storage + 464; } } @@ -3988,7 +4747,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu", 8) == 0) { { -return dev_storage + 335; +return dev_storage + 463; } } @@ -4003,7 +4762,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt", 8) == 0) { { -return dev_storage + 334; +return dev_storage + 462; } } @@ -4018,7 +4777,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds", 8) == 0) { { -return dev_storage + 333; +return dev_storage + 461; } } @@ -4033,7 +4792,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr", 8) == 0) { { -return dev_storage + 332; +return dev_storage + 460; } } @@ -4048,7 +4807,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq", 8) == 0) { { -return dev_storage + 331; +return dev_storage + 459; } } @@ -4066,7 +4825,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp", 8) == 0) { { -return dev_storage + 330; +return dev_storage + 458; } } @@ -4081,7 +4840,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/dsp", 8) == 0) { { -return dev_storage + 85; +return dev_storage + 149; } } @@ -4102,7 +4861,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo", 8) == 0) { { -return dev_storage + 329; +return dev_storage + 457; } } @@ -4117,7 +4876,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn", 8) == 0) { { -return dev_storage + 328; +return dev_storage + 456; } } @@ -4132,7 +4891,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm", 8) == 0) { { -return dev_storage + 327; +return dev_storage + 455; } } @@ -4147,7 +4906,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl", 8) == 0) { { -return dev_storage + 326; +return dev_storage + 454; } } @@ -4162,7 +4921,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk", 8) == 0) { { -return dev_storage + 325; +return dev_storage + 453; } } @@ -4177,7 +4936,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj", 8) == 0) { { -return dev_storage + 324; +return dev_storage + 452; } } @@ -4192,7 +4951,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi", 8) == 0) { { -return dev_storage + 323; +return dev_storage + 451; } } @@ -4207,7 +4966,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh", 8) == 0) { { -return dev_storage + 322; +return dev_storage + 450; } } @@ -4222,7 +4981,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg", 8) == 0) { { -return dev_storage + 321; +return dev_storage + 449; } } @@ -4237,7 +4996,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf", 8) == 0) { { -return dev_storage + 320; +return dev_storage + 448; } } @@ -4252,7 +5011,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde", 8) == 0) { { -return dev_storage + 319; +return dev_storage + 447; } } @@ -4267,7 +5026,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd", 8) == 0) { { -return dev_storage + 318; +return dev_storage + 446; } } @@ -4282,7 +5041,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc", 8) == 0) { { -return dev_storage + 317; +return dev_storage + 445; } } @@ -4297,7 +5056,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb", 8) == 0) { { -return dev_storage + 316; +return dev_storage + 444; } } @@ -4312,7 +5071,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda", 8) == 0) { { -return dev_storage + 315; +return dev_storage + 443; } } @@ -4330,7 +5089,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st9", 8) == 0) { { -return dev_storage + 2388; +return dev_storage + 2516; } } @@ -4345,7 +5104,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr9", 8) == 0) { { -return dev_storage + 2372; +return dev_storage + 2500; } } @@ -4360,7 +5119,37 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd9", 8) == 0) { { -return dev_storage + 95; +return dev_storage + 159; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, ":ptym119", 8) == 0) + { +{ +return dev_storage + 2824; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, ":ptym109", 8) == 0) + { +{ +return dev_storage + 2814; } } @@ -4384,7 +5173,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st8", 8) == 0) { { -return dev_storage + 2387; +return dev_storage + 2515; } } @@ -4399,7 +5188,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr8", 8) == 0) { { -return dev_storage + 2371; +return dev_storage + 2499; } } @@ -4414,7 +5203,37 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd8", 8) == 0) { { -return dev_storage + 94; +return dev_storage + 158; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, ":ptym118", 8) == 0) + { +{ +return dev_storage + 2823; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, ":ptym108", 8) == 0) + { +{ +return dev_storage + 2813; } } @@ -4438,7 +5257,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st7", 8) == 0) { { -return dev_storage + 2386; +return dev_storage + 2514; } } @@ -4453,7 +5272,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr7", 8) == 0) { { -return dev_storage + 2370; +return dev_storage + 2498; } } @@ -4468,7 +5287,52 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd7", 8) == 0) { { -return dev_storage + 93; +return dev_storage + 157; + +} + } + else + { +{ +return NULL; + +} + } + case '2': + if (strncmp (KR_keyword, ":ptym127", 8) == 0) + { +{ +return dev_storage + 2832; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, ":ptym117", 8) == 0) + { +{ +return dev_storage + 2822; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, ":ptym107", 8) == 0) + { +{ +return dev_storage + 2812; } } @@ -4492,7 +5356,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st6", 8) == 0) { { -return dev_storage + 2385; +return dev_storage + 2513; } } @@ -4507,7 +5371,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr6", 8) == 0) { { -return dev_storage + 2369; +return dev_storage + 2497; } } @@ -4522,7 +5386,52 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd6", 8) == 0) { { -return dev_storage + 92; +return dev_storage + 156; + +} + } + else + { +{ +return NULL; + +} + } + case '2': + if (strncmp (KR_keyword, ":ptym126", 8) == 0) + { +{ +return dev_storage + 2831; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, ":ptym116", 8) == 0) + { +{ +return dev_storage + 2821; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, ":ptym106", 8) == 0) + { +{ +return dev_storage + 2811; } } @@ -4546,7 +5455,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st5", 8) == 0) { { -return dev_storage + 2384; +return dev_storage + 2512; } } @@ -4561,7 +5470,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr5", 8) == 0) { { -return dev_storage + 2368; +return dev_storage + 2496; } } @@ -4576,7 +5485,52 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd5", 8) == 0) { { -return dev_storage + 91; +return dev_storage + 155; + +} + } + else + { +{ +return NULL; + +} + } + case '2': + if (strncmp (KR_keyword, ":ptym125", 8) == 0) + { +{ +return dev_storage + 2830; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, ":ptym115", 8) == 0) + { +{ +return dev_storage + 2820; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, ":ptym105", 8) == 0) + { +{ +return dev_storage + 2810; } } @@ -4600,7 +5554,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st4", 8) == 0) { { -return dev_storage + 2383; +return dev_storage + 2511; } } @@ -4615,7 +5569,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr4", 8) == 0) { { -return dev_storage + 2367; +return dev_storage + 2495; } } @@ -4630,7 +5584,52 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd4", 8) == 0) { { -return dev_storage + 90; +return dev_storage + 154; + +} + } + else + { +{ +return NULL; + +} + } + case '2': + if (strncmp (KR_keyword, ":ptym124", 8) == 0) + { +{ +return dev_storage + 2829; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, ":ptym114", 8) == 0) + { +{ +return dev_storage + 2819; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, ":ptym104", 8) == 0) + { +{ +return dev_storage + 2809; } } @@ -4654,7 +5653,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st3", 8) == 0) { { -return dev_storage + 2382; +return dev_storage + 2510; } } @@ -4669,7 +5668,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr3", 8) == 0) { { -return dev_storage + 2366; +return dev_storage + 2494; } } @@ -4684,7 +5683,52 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd3", 8) == 0) { { -return dev_storage + 89; +return dev_storage + 153; + +} + } + else + { +{ +return NULL; + +} + } + case '2': + if (strncmp (KR_keyword, ":ptym123", 8) == 0) + { +{ +return dev_storage + 2828; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, ":ptym113", 8) == 0) + { +{ +return dev_storage + 2818; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, ":ptym103", 8) == 0) + { +{ +return dev_storage + 2808; } } @@ -4708,7 +5752,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st2", 8) == 0) { { -return dev_storage + 2381; +return dev_storage + 2509; } } @@ -4723,7 +5767,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr2", 8) == 0) { { -return dev_storage + 2365; +return dev_storage + 2493; } } @@ -4738,7 +5782,52 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd2", 8) == 0) { { -return dev_storage + 88; +return dev_storage + 152; + +} + } + else + { +{ +return NULL; + +} + } + case '2': + if (strncmp (KR_keyword, ":ptym122", 8) == 0) + { +{ +return dev_storage + 2827; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, ":ptym112", 8) == 0) + { +{ +return dev_storage + 2817; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, ":ptym102", 8) == 0) + { +{ +return dev_storage + 2807; } } @@ -4762,7 +5851,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st1", 8) == 0) { { -return dev_storage + 2380; +return dev_storage + 2508; } } @@ -4777,7 +5866,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr1", 8) == 0) { { -return dev_storage + 2364; +return dev_storage + 2492; } } @@ -4792,7 +5881,52 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd1", 8) == 0) { { -return dev_storage + 87; +return dev_storage + 151; + +} + } + else + { +{ +return NULL; + +} + } + case '2': + if (strncmp (KR_keyword, ":ptym121", 8) == 0) + { +{ +return dev_storage + 2826; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, ":ptym111", 8) == 0) + { +{ +return dev_storage + 2816; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, ":ptym101", 8) == 0) + { +{ +return dev_storage + 2806; } } @@ -4816,7 +5950,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st0", 8) == 0) { { -return dev_storage + 2379; +return dev_storage + 2507; } } @@ -4831,7 +5965,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr0", 8) == 0) { { -return dev_storage + 2363; +return dev_storage + 2491; } } @@ -4846,7 +5980,52 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd0", 8) == 0) { { -return dev_storage + 86; +return dev_storage + 150; + +} + } + else + { +{ +return NULL; + +} + } + case '2': + if (strncmp (KR_keyword, ":ptym120", 8) == 0) + { +{ +return dev_storage + 2825; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, ":ptym110", 8) == 0) + { +{ +return dev_storage + 2815; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, ":ptym100", 8) == 0) + { +{ +return dev_storage + 2805; } } @@ -4879,7 +6058,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz9", 9) == 0) { { -return dev_storage + 724; +return dev_storage + 852; } } @@ -4894,7 +6073,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz8", 9) == 0) { { -return dev_storage + 723; +return dev_storage + 851; } } @@ -4909,7 +6088,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz7", 9) == 0) { { -return dev_storage + 722; +return dev_storage + 850; } } @@ -4924,7 +6103,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz6", 9) == 0) { { -return dev_storage + 721; +return dev_storage + 849; } } @@ -4939,7 +6118,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz5", 9) == 0) { { -return dev_storage + 720; +return dev_storage + 848; } } @@ -4954,7 +6133,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz4", 9) == 0) { { -return dev_storage + 719; +return dev_storage + 847; } } @@ -4969,7 +6148,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz3", 9) == 0) { { -return dev_storage + 718; +return dev_storage + 846; } } @@ -4984,7 +6163,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz2", 9) == 0) { { -return dev_storage + 717; +return dev_storage + 845; } } @@ -4999,7 +6178,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz1", 9) == 0) { { -return dev_storage + 716; +return dev_storage + 844; } } @@ -5026,7 +6205,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy9", 9) == 0) { { -return dev_storage + 709; +return dev_storage + 837; } } @@ -5041,7 +6220,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty9", 9) == 0) { { -return dev_storage + 243; +return dev_storage + 307; } } @@ -5065,7 +6244,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy8", 9) == 0) { { -return dev_storage + 708; +return dev_storage + 836; } } @@ -5080,7 +6259,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty8", 9) == 0) { { -return dev_storage + 242; +return dev_storage + 306; } } @@ -5104,7 +6283,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy7", 9) == 0) { { -return dev_storage + 707; +return dev_storage + 835; } } @@ -5119,7 +6298,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty7", 9) == 0) { { -return dev_storage + 241; +return dev_storage + 305; } } @@ -5143,7 +6322,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy6", 9) == 0) { { -return dev_storage + 706; +return dev_storage + 834; } } @@ -5158,7 +6337,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty6", 9) == 0) { { -return dev_storage + 240; +return dev_storage + 304; } } @@ -5182,7 +6361,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy5", 9) == 0) { { -return dev_storage + 705; +return dev_storage + 833; } } @@ -5197,7 +6376,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty5", 9) == 0) { { -return dev_storage + 239; +return dev_storage + 303; } } @@ -5221,7 +6400,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy4", 9) == 0) { { -return dev_storage + 704; +return dev_storage + 832; } } @@ -5236,7 +6415,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty4", 9) == 0) { { -return dev_storage + 238; +return dev_storage + 302; } } @@ -5260,7 +6439,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy3", 9) == 0) { { -return dev_storage + 703; +return dev_storage + 831; } } @@ -5275,7 +6454,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty3", 9) == 0) { { -return dev_storage + 237; +return dev_storage + 301; } } @@ -5299,7 +6478,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy2", 9) == 0) { { -return dev_storage + 702; +return dev_storage + 830; } } @@ -5314,7 +6493,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty2", 9) == 0) { { -return dev_storage + 236; +return dev_storage + 300; } } @@ -5338,7 +6517,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy1", 9) == 0) { { -return dev_storage + 701; +return dev_storage + 829; } } @@ -5353,7 +6532,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty1", 9) == 0) { { -return dev_storage + 235; +return dev_storage + 299; } } @@ -5374,7 +6553,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty0", 9) == 0) { { -return dev_storage + 234; +return dev_storage + 298; } } @@ -5398,7 +6577,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx9", 9) == 0) { { -return dev_storage + 694; +return dev_storage + 822; } } @@ -5413,7 +6592,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx8", 9) == 0) { { -return dev_storage + 693; +return dev_storage + 821; } } @@ -5428,7 +6607,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx7", 9) == 0) { { -return dev_storage + 692; +return dev_storage + 820; } } @@ -5443,7 +6622,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx6", 9) == 0) { { -return dev_storage + 691; +return dev_storage + 819; } } @@ -5458,7 +6637,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx5", 9) == 0) { { -return dev_storage + 690; +return dev_storage + 818; } } @@ -5473,7 +6652,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx4", 9) == 0) { { -return dev_storage + 689; +return dev_storage + 817; } } @@ -5488,7 +6667,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx3", 9) == 0) { { -return dev_storage + 688; +return dev_storage + 816; } } @@ -5503,7 +6682,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx2", 9) == 0) { { -return dev_storage + 687; +return dev_storage + 815; } } @@ -5518,7 +6697,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx1", 9) == 0) { { -return dev_storage + 686; +return dev_storage + 814; } } @@ -5542,7 +6721,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw9", 9) == 0) { { -return dev_storage + 679; +return dev_storage + 807; } } @@ -5557,7 +6736,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw8", 9) == 0) { { -return dev_storage + 678; +return dev_storage + 806; } } @@ -5572,7 +6751,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw7", 9) == 0) { { -return dev_storage + 677; +return dev_storage + 805; } } @@ -5587,7 +6766,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw6", 9) == 0) { { -return dev_storage + 676; +return dev_storage + 804; } } @@ -5602,7 +6781,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw5", 9) == 0) { { -return dev_storage + 675; +return dev_storage + 803; } } @@ -5617,7 +6796,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw4", 9) == 0) { { -return dev_storage + 674; +return dev_storage + 802; } } @@ -5632,7 +6811,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw3", 9) == 0) { { -return dev_storage + 673; +return dev_storage + 801; } } @@ -5647,7 +6826,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw2", 9) == 0) { { -return dev_storage + 672; +return dev_storage + 800; } } @@ -5662,7 +6841,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw1", 9) == 0) { { -return dev_storage + 671; +return dev_storage + 799; } } @@ -5686,7 +6865,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv9", 9) == 0) { { -return dev_storage + 664; +return dev_storage + 792; } } @@ -5701,7 +6880,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv8", 9) == 0) { { -return dev_storage + 663; +return dev_storage + 791; } } @@ -5716,7 +6895,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv7", 9) == 0) { { -return dev_storage + 662; +return dev_storage + 790; } } @@ -5731,7 +6910,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv6", 9) == 0) { { -return dev_storage + 661; +return dev_storage + 789; } } @@ -5746,7 +6925,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv5", 9) == 0) { { -return dev_storage + 660; +return dev_storage + 788; } } @@ -5761,7 +6940,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv4", 9) == 0) { { -return dev_storage + 659; +return dev_storage + 787; } } @@ -5776,7 +6955,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv3", 9) == 0) { { -return dev_storage + 658; +return dev_storage + 786; } } @@ -5791,7 +6970,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv2", 9) == 0) { { -return dev_storage + 657; +return dev_storage + 785; } } @@ -5806,7 +6985,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv1", 9) == 0) { { -return dev_storage + 656; +return dev_storage + 784; } } @@ -5830,7 +7009,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu9", 9) == 0) { { -return dev_storage + 649; +return dev_storage + 777; } } @@ -5845,7 +7024,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu8", 9) == 0) { { -return dev_storage + 648; +return dev_storage + 776; } } @@ -5860,7 +7039,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu7", 9) == 0) { { -return dev_storage + 647; +return dev_storage + 775; } } @@ -5875,7 +7054,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu6", 9) == 0) { { -return dev_storage + 646; +return dev_storage + 774; } } @@ -5890,7 +7069,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu5", 9) == 0) { { -return dev_storage + 645; +return dev_storage + 773; } } @@ -5905,7 +7084,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu4", 9) == 0) { { -return dev_storage + 644; +return dev_storage + 772; } } @@ -5920,7 +7099,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu3", 9) == 0) { { -return dev_storage + 643; +return dev_storage + 771; } } @@ -5935,7 +7114,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu2", 9) == 0) { { -return dev_storage + 642; +return dev_storage + 770; } } @@ -5950,7 +7129,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu1", 9) == 0) { { -return dev_storage + 641; +return dev_storage + 769; } } @@ -5977,7 +7156,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt9", 9) == 0) { { -return dev_storage + 634; +return dev_storage + 762; } } @@ -5992,7 +7171,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst9", 9) == 0) { { -return dev_storage + 113; +return dev_storage + 177; } } @@ -6016,7 +7195,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt8", 9) == 0) { { -return dev_storage + 633; +return dev_storage + 761; } } @@ -6031,7 +7210,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst8", 9) == 0) { { -return dev_storage + 112; +return dev_storage + 176; } } @@ -6055,7 +7234,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt7", 9) == 0) { { -return dev_storage + 632; +return dev_storage + 760; } } @@ -6070,7 +7249,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst7", 9) == 0) { { -return dev_storage + 111; +return dev_storage + 175; } } @@ -6094,7 +7273,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt6", 9) == 0) { { -return dev_storage + 631; +return dev_storage + 759; } } @@ -6109,7 +7288,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst6", 9) == 0) { { -return dev_storage + 110; +return dev_storage + 174; } } @@ -6133,7 +7312,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt5", 9) == 0) { { -return dev_storage + 630; +return dev_storage + 758; } } @@ -6148,7 +7327,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst5", 9) == 0) { { -return dev_storage + 109; +return dev_storage + 173; } } @@ -6172,7 +7351,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt4", 9) == 0) { { -return dev_storage + 629; +return dev_storage + 757; } } @@ -6187,7 +7366,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst4", 9) == 0) { { -return dev_storage + 108; +return dev_storage + 172; } } @@ -6211,7 +7390,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt3", 9) == 0) { { -return dev_storage + 628; +return dev_storage + 756; } } @@ -6226,7 +7405,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst3", 9) == 0) { { -return dev_storage + 107; +return dev_storage + 171; } } @@ -6250,7 +7429,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt2", 9) == 0) { { -return dev_storage + 627; +return dev_storage + 755; } } @@ -6265,7 +7444,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst2", 9) == 0) { { -return dev_storage + 106; +return dev_storage + 170; } } @@ -6289,7 +7468,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt1", 9) == 0) { { -return dev_storage + 626; +return dev_storage + 754; } } @@ -6304,7 +7483,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst1", 9) == 0) { { -return dev_storage + 105; +return dev_storage + 169; } } @@ -6325,7 +7504,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst0", 9) == 0) { { -return dev_storage + 104; +return dev_storage + 168; } } @@ -6349,7 +7528,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/kmsg", 9) == 0) { { -return dev_storage + 103; +return dev_storage + 167; } } @@ -6364,7 +7543,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds9", 9) == 0) { { -return dev_storage + 619; +return dev_storage + 747; } } @@ -6379,7 +7558,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds8", 9) == 0) { { -return dev_storage + 618; +return dev_storage + 746; } } @@ -6394,7 +7573,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds7", 9) == 0) { { -return dev_storage + 617; +return dev_storage + 745; } } @@ -6409,7 +7588,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds6", 9) == 0) { { -return dev_storage + 616; +return dev_storage + 744; } } @@ -6424,7 +7603,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds5", 9) == 0) { { -return dev_storage + 615; +return dev_storage + 743; } } @@ -6439,7 +7618,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds4", 9) == 0) { { -return dev_storage + 614; +return dev_storage + 742; } } @@ -6454,7 +7633,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds3", 9) == 0) { { -return dev_storage + 613; +return dev_storage + 741; } } @@ -6469,7 +7648,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds2", 9) == 0) { { -return dev_storage + 612; +return dev_storage + 740; } } @@ -6484,7 +7663,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds1", 9) == 0) { { -return dev_storage + 611; +return dev_storage + 739; } } @@ -6508,7 +7687,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/zero", 9) == 0) { { -return dev_storage + 2574; +return dev_storage + 2702; } } @@ -6523,7 +7702,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr9", 9) == 0) { { -return dev_storage + 604; +return dev_storage + 732; } } @@ -6538,7 +7717,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr8", 9) == 0) { { -return dev_storage + 603; +return dev_storage + 731; } } @@ -6553,7 +7732,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr7", 9) == 0) { { -return dev_storage + 602; +return dev_storage + 730; } } @@ -6568,7 +7747,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr6", 9) == 0) { { -return dev_storage + 601; +return dev_storage + 729; } } @@ -6583,7 +7762,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr5", 9) == 0) { { -return dev_storage + 600; +return dev_storage + 728; } } @@ -6598,7 +7777,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr4", 9) == 0) { { -return dev_storage + 599; +return dev_storage + 727; } } @@ -6613,7 +7792,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr3", 9) == 0) { { -return dev_storage + 598; +return dev_storage + 726; } } @@ -6628,7 +7807,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr2", 9) == 0) { { -return dev_storage + 597; +return dev_storage + 725; } } @@ -6643,7 +7822,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr1", 9) == 0) { { -return dev_storage + 596; +return dev_storage + 724; } } @@ -6667,7 +7846,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq9", 9) == 0) { { -return dev_storage + 589; +return dev_storage + 717; } } @@ -6682,7 +7861,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq8", 9) == 0) { { -return dev_storage + 588; +return dev_storage + 716; } } @@ -6697,7 +7876,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq7", 9) == 0) { { -return dev_storage + 587; +return dev_storage + 715; } } @@ -6712,7 +7891,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq6", 9) == 0) { { -return dev_storage + 586; +return dev_storage + 714; } } @@ -6727,7 +7906,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq5", 9) == 0) { { -return dev_storage + 585; +return dev_storage + 713; } } @@ -6742,7 +7921,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq4", 9) == 0) { { -return dev_storage + 584; +return dev_storage + 712; } } @@ -6757,7 +7936,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq3", 9) == 0) { { -return dev_storage + 583; +return dev_storage + 711; } } @@ -6772,7 +7951,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq2", 9) == 0) { { -return dev_storage + 582; +return dev_storage + 710; } } @@ -6787,7 +7966,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq1", 9) == 0) { { -return dev_storage + 581; +return dev_storage + 709; } } @@ -6811,7 +7990,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp9", 9) == 0) { { -return dev_storage + 574; +return dev_storage + 702; } } @@ -6826,7 +8005,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp8", 9) == 0) { { -return dev_storage + 573; +return dev_storage + 701; } } @@ -6841,7 +8020,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp7", 9) == 0) { { -return dev_storage + 572; +return dev_storage + 700; } } @@ -6856,7 +8035,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp6", 9) == 0) { { -return dev_storage + 571; +return dev_storage + 699; } } @@ -6871,7 +8050,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp5", 9) == 0) { { -return dev_storage + 570; +return dev_storage + 698; } } @@ -6886,7 +8065,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp4", 9) == 0) { { -return dev_storage + 569; +return dev_storage + 697; } } @@ -6901,7 +8080,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp3", 9) == 0) { { -return dev_storage + 568; +return dev_storage + 696; } } @@ -6916,7 +8095,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp2", 9) == 0) { { -return dev_storage + 567; +return dev_storage + 695; } } @@ -6931,7 +8110,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp1", 9) == 0) { { -return dev_storage + 566; +return dev_storage + 694; } } @@ -6955,7 +8134,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo9", 9) == 0) { { -return dev_storage + 559; +return dev_storage + 687; } } @@ -6970,7 +8149,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo8", 9) == 0) { { -return dev_storage + 558; +return dev_storage + 686; } } @@ -6985,7 +8164,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo7", 9) == 0) { { -return dev_storage + 557; +return dev_storage + 685; } } @@ -7000,7 +8179,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo6", 9) == 0) { { -return dev_storage + 556; +return dev_storage + 684; } } @@ -7015,7 +8194,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo5", 9) == 0) { { -return dev_storage + 555; +return dev_storage + 683; } } @@ -7030,7 +8209,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo4", 9) == 0) { { -return dev_storage + 554; +return dev_storage + 682; } } @@ -7045,7 +8224,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo3", 9) == 0) { { -return dev_storage + 553; +return dev_storage + 681; } } @@ -7060,7 +8239,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo2", 9) == 0) { { -return dev_storage + 552; +return dev_storage + 680; } } @@ -7075,7 +8254,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo1", 9) == 0) { { -return dev_storage + 551; +return dev_storage + 679; } } @@ -7099,7 +8278,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn9", 9) == 0) { { -return dev_storage + 544; +return dev_storage + 672; } } @@ -7114,7 +8293,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn8", 9) == 0) { { -return dev_storage + 543; +return dev_storage + 671; } } @@ -7129,7 +8308,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn7", 9) == 0) { { -return dev_storage + 542; +return dev_storage + 670; } } @@ -7144,7 +8323,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn6", 9) == 0) { { -return dev_storage + 541; +return dev_storage + 669; } } @@ -7159,7 +8338,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn5", 9) == 0) { { -return dev_storage + 540; +return dev_storage + 668; } } @@ -7174,7 +8353,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn4", 9) == 0) { { -return dev_storage + 539; +return dev_storage + 667; } } @@ -7189,7 +8368,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn3", 9) == 0) { { -return dev_storage + 538; +return dev_storage + 666; } } @@ -7204,7 +8383,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn2", 9) == 0) { { -return dev_storage + 537; +return dev_storage + 665; } } @@ -7219,7 +8398,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn1", 9) == 0) { { -return dev_storage + 536; +return dev_storage + 664; } } @@ -7246,7 +8425,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm9", 9) == 0) { { -return dev_storage + 529; +return dev_storage + 657; } } @@ -7261,7 +8440,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm8", 9) == 0) { { -return dev_storage + 528; +return dev_storage + 656; } } @@ -7276,7 +8455,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm7", 9) == 0) { { -return dev_storage + 527; +return dev_storage + 655; } } @@ -7291,7 +8470,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm6", 9) == 0) { { -return dev_storage + 526; +return dev_storage + 654; } } @@ -7306,7 +8485,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm5", 9) == 0) { { -return dev_storage + 525; +return dev_storage + 653; } } @@ -7321,7 +8500,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm4", 9) == 0) { { -return dev_storage + 524; +return dev_storage + 652; } } @@ -7336,7 +8515,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm3", 9) == 0) { { -return dev_storage + 523; +return dev_storage + 651; } } @@ -7351,7 +8530,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm2", 9) == 0) { { -return dev_storage + 522; +return dev_storage + 650; } } @@ -7366,7 +8545,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm1", 9) == 0) { { -return dev_storage + 521; +return dev_storage + 649; } } @@ -7387,7 +8566,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ptmx", 9) == 0) { { -return dev_storage + 233; +return dev_storage + 297; } } @@ -7558,7 +8737,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/null", 9) == 0) { { -return dev_storage + 232; +return dev_storage + 296; } } @@ -7573,7 +8752,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/full", 9) == 0) { { -return dev_storage + 102; +return dev_storage + 166; } } @@ -7594,7 +8773,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl9", 9) == 0) { { -return dev_storage + 514; +return dev_storage + 642; } } @@ -7609,7 +8788,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl8", 9) == 0) { { -return dev_storage + 513; +return dev_storage + 641; } } @@ -7624,7 +8803,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl7", 9) == 0) { { -return dev_storage + 512; +return dev_storage + 640; } } @@ -7639,7 +8818,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl6", 9) == 0) { { -return dev_storage + 511; +return dev_storage + 639; } } @@ -7654,7 +8833,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl5", 9) == 0) { { -return dev_storage + 510; +return dev_storage + 638; } } @@ -7669,7 +8848,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl4", 9) == 0) { { -return dev_storage + 509; +return dev_storage + 637; } } @@ -7684,7 +8863,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl3", 9) == 0) { { -return dev_storage + 508; +return dev_storage + 636; } } @@ -7699,7 +8878,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl2", 9) == 0) { { -return dev_storage + 507; +return dev_storage + 635; } } @@ -7714,7 +8893,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl1", 9) == 0) { { -return dev_storage + 506; +return dev_storage + 634; } } @@ -7738,7 +8917,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk9", 9) == 0) { { -return dev_storage + 499; +return dev_storage + 627; } } @@ -7753,7 +8932,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk8", 9) == 0) { { -return dev_storage + 498; +return dev_storage + 626; } } @@ -7768,7 +8947,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk7", 9) == 0) { { -return dev_storage + 497; +return dev_storage + 625; } } @@ -7783,7 +8962,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk6", 9) == 0) { { -return dev_storage + 496; +return dev_storage + 624; } } @@ -7798,7 +8977,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk5", 9) == 0) { { -return dev_storage + 495; +return dev_storage + 623; } } @@ -7813,7 +8992,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk4", 9) == 0) { { -return dev_storage + 494; +return dev_storage + 622; } } @@ -7828,7 +9007,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk3", 9) == 0) { { -return dev_storage + 493; +return dev_storage + 621; } } @@ -7843,7 +9022,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk2", 9) == 0) { { -return dev_storage + 492; +return dev_storage + 620; } } @@ -7858,7 +9037,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk1", 9) == 0) { { -return dev_storage + 491; +return dev_storage + 619; } } @@ -7882,7 +9061,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj9", 9) == 0) { { -return dev_storage + 484; +return dev_storage + 612; } } @@ -7897,7 +9076,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj8", 9) == 0) { { -return dev_storage + 483; +return dev_storage + 611; } } @@ -7912,7 +9091,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj7", 9) == 0) { { -return dev_storage + 482; +return dev_storage + 610; } } @@ -7927,7 +9106,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj6", 9) == 0) { { -return dev_storage + 481; +return dev_storage + 609; } } @@ -7942,7 +9121,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj5", 9) == 0) { { -return dev_storage + 480; +return dev_storage + 608; } } @@ -7957,7 +9136,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj4", 9) == 0) { { -return dev_storage + 479; +return dev_storage + 607; } } @@ -7972,7 +9151,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj3", 9) == 0) { { -return dev_storage + 478; +return dev_storage + 606; } } @@ -7987,7 +9166,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj2", 9) == 0) { { -return dev_storage + 477; +return dev_storage + 605; } } @@ -8002,7 +9181,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj1", 9) == 0) { { -return dev_storage + 476; +return dev_storage + 604; } } @@ -8026,7 +9205,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi9", 9) == 0) { { -return dev_storage + 469; +return dev_storage + 597; } } @@ -8041,7 +9220,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi8", 9) == 0) { { -return dev_storage + 468; +return dev_storage + 596; } } @@ -8056,7 +9235,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi7", 9) == 0) { { -return dev_storage + 467; +return dev_storage + 595; } } @@ -8071,7 +9250,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi6", 9) == 0) { { -return dev_storage + 466; +return dev_storage + 594; } } @@ -8086,7 +9265,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi5", 9) == 0) { { -return dev_storage + 465; +return dev_storage + 593; } } @@ -8101,7 +9280,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi4", 9) == 0) { { -return dev_storage + 464; +return dev_storage + 592; } } @@ -8116,7 +9295,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi3", 9) == 0) { { -return dev_storage + 463; +return dev_storage + 591; } } @@ -8131,7 +9310,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi2", 9) == 0) { { -return dev_storage + 462; +return dev_storage + 590; } } @@ -8146,7 +9325,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi1", 9) == 0) { { -return dev_storage + 461; +return dev_storage + 589; } } @@ -8170,7 +9349,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh9", 9) == 0) { { -return dev_storage + 454; +return dev_storage + 582; } } @@ -8185,7 +9364,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh8", 9) == 0) { { -return dev_storage + 453; +return dev_storage + 581; } } @@ -8200,7 +9379,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh7", 9) == 0) { { -return dev_storage + 452; +return dev_storage + 580; } } @@ -8215,7 +9394,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh6", 9) == 0) { { -return dev_storage + 451; +return dev_storage + 579; } } @@ -8230,7 +9409,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh5", 9) == 0) { { -return dev_storage + 450; +return dev_storage + 578; } } @@ -8245,7 +9424,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh4", 9) == 0) { { -return dev_storage + 449; +return dev_storage + 577; } } @@ -8260,7 +9439,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh3", 9) == 0) { { -return dev_storage + 448; +return dev_storage + 576; } } @@ -8275,7 +9454,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh2", 9) == 0) { { -return dev_storage + 447; +return dev_storage + 575; } } @@ -8290,7 +9469,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh1", 9) == 0) { { -return dev_storage + 446; +return dev_storage + 574; } } @@ -8314,7 +9493,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg9", 9) == 0) { { -return dev_storage + 439; +return dev_storage + 567; } } @@ -8329,7 +9508,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg8", 9) == 0) { { -return dev_storage + 438; +return dev_storage + 566; } } @@ -8344,7 +9523,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg7", 9) == 0) { { -return dev_storage + 437; +return dev_storage + 565; } } @@ -8359,7 +9538,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg6", 9) == 0) { { -return dev_storage + 436; +return dev_storage + 564; } } @@ -8374,7 +9553,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg5", 9) == 0) { { -return dev_storage + 435; +return dev_storage + 563; } } @@ -8389,7 +9568,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg4", 9) == 0) { { -return dev_storage + 434; +return dev_storage + 562; } } @@ -8404,7 +9583,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg3", 9) == 0) { { -return dev_storage + 433; +return dev_storage + 561; } } @@ -8419,7 +9598,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg2", 9) == 0) { { -return dev_storage + 432; +return dev_storage + 560; } } @@ -8434,7 +9613,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg1", 9) == 0) { { -return dev_storage + 431; +return dev_storage + 559; } } @@ -8458,7 +9637,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf9", 9) == 0) { { -return dev_storage + 424; +return dev_storage + 552; } } @@ -8473,7 +9652,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf8", 9) == 0) { { -return dev_storage + 423; +return dev_storage + 551; } } @@ -8488,7 +9667,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf7", 9) == 0) { { -return dev_storage + 422; +return dev_storage + 550; } } @@ -8503,7 +9682,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf6", 9) == 0) { { -return dev_storage + 421; +return dev_storage + 549; } } @@ -8518,7 +9697,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf5", 9) == 0) { { -return dev_storage + 420; +return dev_storage + 548; } } @@ -8533,7 +9712,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf4", 9) == 0) { { -return dev_storage + 419; +return dev_storage + 547; } } @@ -8548,7 +9727,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf3", 9) == 0) { { -return dev_storage + 418; +return dev_storage + 546; } } @@ -8563,7 +9742,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf2", 9) == 0) { { -return dev_storage + 417; +return dev_storage + 545; } } @@ -8578,7 +9757,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf1", 9) == 0) { { -return dev_storage + 416; +return dev_storage + 544; } } @@ -8602,7 +9781,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde9", 9) == 0) { { -return dev_storage + 409; +return dev_storage + 537; } } @@ -8617,7 +9796,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde8", 9) == 0) { { -return dev_storage + 408; +return dev_storage + 536; } } @@ -8632,7 +9811,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde7", 9) == 0) { { -return dev_storage + 407; +return dev_storage + 535; } } @@ -8647,7 +9826,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde6", 9) == 0) { { -return dev_storage + 406; +return dev_storage + 534; } } @@ -8662,7 +9841,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde5", 9) == 0) { { -return dev_storage + 405; +return dev_storage + 533; } } @@ -8677,7 +9856,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde4", 9) == 0) { { -return dev_storage + 404; +return dev_storage + 532; } } @@ -8692,7 +9871,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde3", 9) == 0) { { -return dev_storage + 403; +return dev_storage + 531; } } @@ -8707,7 +9886,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde2", 9) == 0) { { -return dev_storage + 402; +return dev_storage + 530; } } @@ -8722,7 +9901,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde1", 9) == 0) { { -return dev_storage + 401; +return dev_storage + 529; } } @@ -8746,7 +9925,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx", 9) == 0) { { -return dev_storage + 2002; +return dev_storage + 2130; } } @@ -8761,7 +9940,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw", 9) == 0) { { -return dev_storage + 2001; +return dev_storage + 2129; } } @@ -8776,7 +9955,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv", 9) == 0) { { -return dev_storage + 2000; +return dev_storage + 2128; } } @@ -8791,7 +9970,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu", 9) == 0) { { -return dev_storage + 1999; +return dev_storage + 2127; } } @@ -8806,7 +9985,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt", 9) == 0) { { -return dev_storage + 1998; +return dev_storage + 2126; } } @@ -8821,7 +10000,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds", 9) == 0) { { -return dev_storage + 1997; +return dev_storage + 2125; } } @@ -8836,7 +10015,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr", 9) == 0) { { -return dev_storage + 1996; +return dev_storage + 2124; } } @@ -8851,7 +10030,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq", 9) == 0) { { -return dev_storage + 1995; +return dev_storage + 2123; } } @@ -8866,7 +10045,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp", 9) == 0) { { -return dev_storage + 1994; +return dev_storage + 2122; } } @@ -8881,7 +10060,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo", 9) == 0) { { -return dev_storage + 1993; +return dev_storage + 2121; } } @@ -8896,7 +10075,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn", 9) == 0) { { -return dev_storage + 1992; +return dev_storage + 2120; } } @@ -8911,7 +10090,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm", 9) == 0) { { -return dev_storage + 1991; +return dev_storage + 2119; } } @@ -8926,7 +10105,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl", 9) == 0) { { -return dev_storage + 1990; +return dev_storage + 2118; } } @@ -8941,7 +10120,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk", 9) == 0) { { -return dev_storage + 1989; +return dev_storage + 2117; } } @@ -8956,7 +10135,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj", 9) == 0) { { -return dev_storage + 1988; +return dev_storage + 2116; } } @@ -8971,7 +10150,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi", 9) == 0) { { -return dev_storage + 1987; +return dev_storage + 2115; } } @@ -8986,7 +10165,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh", 9) == 0) { { -return dev_storage + 1986; +return dev_storage + 2114; } } @@ -9001,7 +10180,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg", 9) == 0) { { -return dev_storage + 1985; +return dev_storage + 2113; } } @@ -9016,7 +10195,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf", 9) == 0) { { -return dev_storage + 1984; +return dev_storage + 2112; } } @@ -9031,7 +10210,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde", 9) == 0) { { -return dev_storage + 1983; +return dev_storage + 2111; } } @@ -9046,7 +10225,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd", 9) == 0) { { -return dev_storage + 1982; +return dev_storage + 2110; } } @@ -9061,7 +10240,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc", 9) == 0) { { -return dev_storage + 1981; +return dev_storage + 2109; } } @@ -9076,7 +10255,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb", 9) == 0) { { -return dev_storage + 1980; +return dev_storage + 2108; } } @@ -9091,7 +10270,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda", 9) == 0) { { -return dev_storage + 1979; +return dev_storage + 2107; } } @@ -9109,7 +10288,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd9", 9) == 0) { { -return dev_storage + 394; +return dev_storage + 522; } } @@ -9124,7 +10303,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd9", 9) == 0) { { -return dev_storage + 308; +return dev_storage + 436; } } @@ -9148,7 +10327,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd8", 9) == 0) { { -return dev_storage + 393; +return dev_storage + 521; } } @@ -9163,7 +10342,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd8", 9) == 0) { { -return dev_storage + 307; +return dev_storage + 435; } } @@ -9187,7 +10366,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd7", 9) == 0) { { -return dev_storage + 392; +return dev_storage + 520; } } @@ -9202,7 +10381,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd7", 9) == 0) { { -return dev_storage + 306; +return dev_storage + 434; } } @@ -9226,7 +10405,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd6", 9) == 0) { { -return dev_storage + 391; +return dev_storage + 519; } } @@ -9241,7 +10420,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd6", 9) == 0) { { -return dev_storage + 305; +return dev_storage + 433; } } @@ -9265,7 +10444,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd5", 9) == 0) { { -return dev_storage + 390; +return dev_storage + 518; } } @@ -9280,7 +10459,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd5", 9) == 0) { { -return dev_storage + 304; +return dev_storage + 432; } } @@ -9304,7 +10483,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd4", 9) == 0) { { -return dev_storage + 389; +return dev_storage + 517; } } @@ -9319,7 +10498,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd4", 9) == 0) { { -return dev_storage + 303; +return dev_storage + 431; } } @@ -9343,7 +10522,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd3", 9) == 0) { { -return dev_storage + 388; +return dev_storage + 516; } } @@ -9358,7 +10537,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd3", 9) == 0) { { -return dev_storage + 302; +return dev_storage + 430; } } @@ -9382,7 +10561,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd2", 9) == 0) { { -return dev_storage + 387; +return dev_storage + 515; } } @@ -9397,7 +10576,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd2", 9) == 0) { { -return dev_storage + 301; +return dev_storage + 429; } } @@ -9421,7 +10600,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd1", 9) == 0) { { -return dev_storage + 386; +return dev_storage + 514; } } @@ -9436,7 +10615,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd1", 9) == 0) { { -return dev_storage + 300; +return dev_storage + 428; } } @@ -9457,7 +10636,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd0", 9) == 0) { { -return dev_storage + 299; +return dev_storage + 427; } } @@ -9481,7 +10660,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz", 9) == 0) { { -return dev_storage + 1588; +return dev_storage + 1716; } } @@ -9496,7 +10675,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy", 9) == 0) { { -return dev_storage + 1587; +return dev_storage + 1715; } } @@ -9511,7 +10690,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx", 9) == 0) { { -return dev_storage + 1586; +return dev_storage + 1714; } } @@ -9526,7 +10705,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw", 9) == 0) { { -return dev_storage + 1585; +return dev_storage + 1713; } } @@ -9541,7 +10720,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv", 9) == 0) { { -return dev_storage + 1584; +return dev_storage + 1712; } } @@ -9556,7 +10735,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu", 9) == 0) { { -return dev_storage + 1583; +return dev_storage + 1711; } } @@ -9571,7 +10750,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct", 9) == 0) { { -return dev_storage + 1582; +return dev_storage + 1710; } } @@ -9586,7 +10765,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs", 9) == 0) { { -return dev_storage + 1581; +return dev_storage + 1709; } } @@ -9601,7 +10780,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr", 9) == 0) { { -return dev_storage + 1580; +return dev_storage + 1708; } } @@ -9616,7 +10795,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq", 9) == 0) { { -return dev_storage + 1579; +return dev_storage + 1707; } } @@ -9631,7 +10810,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp", 9) == 0) { { -return dev_storage + 1578; +return dev_storage + 1706; } } @@ -9646,7 +10825,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco", 9) == 0) { { -return dev_storage + 1577; +return dev_storage + 1705; } } @@ -9661,7 +10840,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn", 9) == 0) { { -return dev_storage + 1576; +return dev_storage + 1704; } } @@ -9676,7 +10855,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm", 9) == 0) { { -return dev_storage + 1575; +return dev_storage + 1703; } } @@ -9691,7 +10870,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl", 9) == 0) { { -return dev_storage + 1574; +return dev_storage + 1702; } } @@ -9706,7 +10885,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck", 9) == 0) { { -return dev_storage + 1573; +return dev_storage + 1701; } } @@ -9721,7 +10900,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj", 9) == 0) { { -return dev_storage + 1572; +return dev_storage + 1700; } } @@ -9736,7 +10915,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci", 9) == 0) { { -return dev_storage + 1571; +return dev_storage + 1699; } } @@ -9751,7 +10930,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch", 9) == 0) { { -return dev_storage + 1570; +return dev_storage + 1698; } } @@ -9766,7 +10945,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg", 9) == 0) { { -return dev_storage + 1569; +return dev_storage + 1697; } } @@ -9781,7 +10960,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf", 9) == 0) { { -return dev_storage + 1568; +return dev_storage + 1696; } } @@ -9796,7 +10975,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce", 9) == 0) { { -return dev_storage + 1567; +return dev_storage + 1695; } } @@ -9811,7 +10990,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd", 9) == 0) { { -return dev_storage + 1566; +return dev_storage + 1694; } } @@ -9826,7 +11005,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc", 9) == 0) { { -return dev_storage + 1565; +return dev_storage + 1693; } } @@ -9841,7 +11020,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb", 9) == 0) { { -return dev_storage + 1564; +return dev_storage + 1692; } } @@ -9856,7 +11035,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca", 9) == 0) { { -return dev_storage + 1563; +return dev_storage + 1691; } } @@ -9871,7 +11050,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc9", 9) == 0) { { -return dev_storage + 379; +return dev_storage + 507; } } @@ -9886,7 +11065,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc8", 9) == 0) { { -return dev_storage + 378; +return dev_storage + 506; } } @@ -9901,7 +11080,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc7", 9) == 0) { { -return dev_storage + 377; +return dev_storage + 505; } } @@ -9916,7 +11095,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc6", 9) == 0) { { -return dev_storage + 376; +return dev_storage + 504; } } @@ -9931,7 +11110,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc5", 9) == 0) { { -return dev_storage + 375; +return dev_storage + 503; } } @@ -9946,7 +11125,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc4", 9) == 0) { { -return dev_storage + 374; +return dev_storage + 502; } } @@ -9961,7 +11140,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc3", 9) == 0) { { -return dev_storage + 373; +return dev_storage + 501; } } @@ -9976,7 +11155,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc2", 9) == 0) { { -return dev_storage + 372; +return dev_storage + 500; } } @@ -9991,7 +11170,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc1", 9) == 0) { { -return dev_storage + 371; +return dev_storage + 499; } } @@ -10015,7 +11194,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz", 9) == 0) { { -return dev_storage + 1172; +return dev_storage + 1300; } } @@ -10030,7 +11209,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby", 9) == 0) { { -return dev_storage + 1171; +return dev_storage + 1299; } } @@ -10045,7 +11224,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx", 9) == 0) { { -return dev_storage + 1170; +return dev_storage + 1298; } } @@ -10060,7 +11239,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw", 9) == 0) { { -return dev_storage + 1169; +return dev_storage + 1297; } } @@ -10075,7 +11254,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv", 9) == 0) { { -return dev_storage + 1168; +return dev_storage + 1296; } } @@ -10090,7 +11269,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu", 9) == 0) { { -return dev_storage + 1167; +return dev_storage + 1295; } } @@ -10105,7 +11284,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt", 9) == 0) { { -return dev_storage + 1166; +return dev_storage + 1294; } } @@ -10120,7 +11299,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs", 9) == 0) { { -return dev_storage + 1165; +return dev_storage + 1293; } } @@ -10135,7 +11314,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr", 9) == 0) { { -return dev_storage + 1164; +return dev_storage + 1292; } } @@ -10150,7 +11329,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq", 9) == 0) { { -return dev_storage + 1163; +return dev_storage + 1291; } } @@ -10165,7 +11344,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp", 9) == 0) { { -return dev_storage + 1162; +return dev_storage + 1290; } } @@ -10180,7 +11359,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo", 9) == 0) { { -return dev_storage + 1161; +return dev_storage + 1289; } } @@ -10195,7 +11374,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn", 9) == 0) { { -return dev_storage + 1160; +return dev_storage + 1288; } } @@ -10210,7 +11389,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm", 9) == 0) { { -return dev_storage + 1159; +return dev_storage + 1287; } } @@ -10225,7 +11404,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl", 9) == 0) { { -return dev_storage + 1158; +return dev_storage + 1286; } } @@ -10240,7 +11419,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk", 9) == 0) { { -return dev_storage + 1157; +return dev_storage + 1285; } } @@ -10255,7 +11434,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj", 9) == 0) { { -return dev_storage + 1156; +return dev_storage + 1284; } } @@ -10270,7 +11449,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi", 9) == 0) { { -return dev_storage + 1155; +return dev_storage + 1283; } } @@ -10285,7 +11464,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh", 9) == 0) { { -return dev_storage + 1154; +return dev_storage + 1282; } } @@ -10300,7 +11479,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg", 9) == 0) { { -return dev_storage + 1153; +return dev_storage + 1281; } } @@ -10315,7 +11494,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf", 9) == 0) { { -return dev_storage + 1152; +return dev_storage + 1280; } } @@ -10330,7 +11509,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe", 9) == 0) { { -return dev_storage + 1151; +return dev_storage + 1279; } } @@ -10345,7 +11524,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd", 9) == 0) { { -return dev_storage + 1150; +return dev_storage + 1278; } } @@ -10360,7 +11539,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc", 9) == 0) { { -return dev_storage + 1149; +return dev_storage + 1277; } } @@ -10375,7 +11554,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb", 9) == 0) { { -return dev_storage + 1148; +return dev_storage + 1276; } } @@ -10390,7 +11569,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba", 9) == 0) { { -return dev_storage + 1147; +return dev_storage + 1275; } } @@ -10405,7 +11584,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb9", 9) == 0) { { -return dev_storage + 364; +return dev_storage + 492; } } @@ -10420,7 +11599,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb8", 9) == 0) { { -return dev_storage + 363; +return dev_storage + 491; } } @@ -10435,7 +11614,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb7", 9) == 0) { { -return dev_storage + 362; +return dev_storage + 490; } } @@ -10450,7 +11629,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb6", 9) == 0) { { -return dev_storage + 361; +return dev_storage + 489; } } @@ -10465,7 +11644,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb5", 9) == 0) { { -return dev_storage + 360; +return dev_storage + 488; } } @@ -10480,7 +11659,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb4", 9) == 0) { { -return dev_storage + 359; +return dev_storage + 487; } } @@ -10495,7 +11674,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb3", 9) == 0) { { -return dev_storage + 358; +return dev_storage + 486; } } @@ -10510,7 +11689,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb2", 9) == 0) { { -return dev_storage + 357; +return dev_storage + 485; } } @@ -10525,7 +11704,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb1", 9) == 0) { { -return dev_storage + 356; +return dev_storage + 484; } } @@ -10549,7 +11728,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz", 9) == 0) { { -return dev_storage + 756; +return dev_storage + 884; } } @@ -10564,7 +11743,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday", 9) == 0) { { -return dev_storage + 755; +return dev_storage + 883; } } @@ -10579,7 +11758,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax", 9) == 0) { { -return dev_storage + 754; +return dev_storage + 882; } } @@ -10594,7 +11773,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw", 9) == 0) { { -return dev_storage + 753; +return dev_storage + 881; } } @@ -10609,7 +11788,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav", 9) == 0) { { -return dev_storage + 752; +return dev_storage + 880; } } @@ -10624,7 +11803,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau", 9) == 0) { { -return dev_storage + 751; +return dev_storage + 879; } } @@ -10639,7 +11818,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat", 9) == 0) { { -return dev_storage + 750; +return dev_storage + 878; } } @@ -10654,7 +11833,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas", 9) == 0) { { -return dev_storage + 749; +return dev_storage + 877; } } @@ -10669,7 +11848,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar", 9) == 0) { { -return dev_storage + 748; +return dev_storage + 876; } } @@ -10684,7 +11863,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq", 9) == 0) { { -return dev_storage + 747; +return dev_storage + 875; } } @@ -10699,7 +11878,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap", 9) == 0) { { -return dev_storage + 746; +return dev_storage + 874; } } @@ -10714,7 +11893,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao", 9) == 0) { { -return dev_storage + 745; +return dev_storage + 873; } } @@ -10729,7 +11908,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan", 9) == 0) { { -return dev_storage + 744; +return dev_storage + 872; } } @@ -10744,7 +11923,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam", 9) == 0) { { -return dev_storage + 743; +return dev_storage + 871; } } @@ -10759,7 +11938,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal", 9) == 0) { { -return dev_storage + 742; +return dev_storage + 870; } } @@ -10774,7 +11953,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak", 9) == 0) { { -return dev_storage + 741; +return dev_storage + 869; } } @@ -10789,7 +11968,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj", 9) == 0) { { -return dev_storage + 740; +return dev_storage + 868; } } @@ -10804,7 +11983,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai", 9) == 0) { { -return dev_storage + 739; +return dev_storage + 867; } } @@ -10819,7 +11998,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah", 9) == 0) { { -return dev_storage + 738; +return dev_storage + 866; } } @@ -10834,7 +12013,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag", 9) == 0) { { -return dev_storage + 737; +return dev_storage + 865; } } @@ -10849,7 +12028,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf", 9) == 0) { { -return dev_storage + 736; +return dev_storage + 864; } } @@ -10864,7 +12043,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae", 9) == 0) { { -return dev_storage + 735; +return dev_storage + 863; } } @@ -10879,7 +12058,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad", 9) == 0) { { -return dev_storage + 734; +return dev_storage + 862; } } @@ -10894,7 +12073,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac", 9) == 0) { { -return dev_storage + 733; +return dev_storage + 861; } } @@ -10909,7 +12088,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab", 9) == 0) { { -return dev_storage + 732; +return dev_storage + 860; } } @@ -10924,7 +12103,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa", 9) == 0) { { -return dev_storage + 731; +return dev_storage + 859; } } @@ -10939,7 +12118,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda9", 9) == 0) { { -return dev_storage + 349; +return dev_storage + 477; } } @@ -10954,7 +12133,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda8", 9) == 0) { { -return dev_storage + 348; +return dev_storage + 476; } } @@ -10969,7 +12148,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda7", 9) == 0) { { -return dev_storage + 347; +return dev_storage + 475; } } @@ -10984,7 +12163,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda6", 9) == 0) { { -return dev_storage + 346; +return dev_storage + 474; } } @@ -10999,7 +12178,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda5", 9) == 0) { { -return dev_storage + 345; +return dev_storage + 473; } } @@ -11014,7 +12193,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda4", 9) == 0) { { -return dev_storage + 344; +return dev_storage + 472; } } @@ -11029,7 +12208,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda3", 9) == 0) { { -return dev_storage + 343; +return dev_storage + 471; } } @@ -11044,7 +12223,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda2", 9) == 0) { { -return dev_storage + 342; +return dev_storage + 470; } } @@ -11059,7 +12238,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda1", 9) == 0) { { -return dev_storage + 341; +return dev_storage + 469; } } @@ -11083,7 +12262,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st99", 9) == 0) { { -return dev_storage + 2478; +return dev_storage + 2606; } } @@ -11098,7 +12277,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st98", 9) == 0) { { -return dev_storage + 2477; +return dev_storage + 2605; } } @@ -11113,7 +12292,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st97", 9) == 0) { { -return dev_storage + 2476; +return dev_storage + 2604; } } @@ -11128,7 +12307,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st96", 9) == 0) { { -return dev_storage + 2475; +return dev_storage + 2603; } } @@ -11143,7 +12322,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st95", 9) == 0) { { -return dev_storage + 2474; +return dev_storage + 2602; } } @@ -11158,7 +12337,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st94", 9) == 0) { { -return dev_storage + 2473; +return dev_storage + 2601; } } @@ -11173,7 +12352,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st93", 9) == 0) { { -return dev_storage + 2472; +return dev_storage + 2600; } } @@ -11188,7 +12367,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st92", 9) == 0) { { -return dev_storage + 2471; +return dev_storage + 2599; } } @@ -11203,7 +12382,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st91", 9) == 0) { { -return dev_storage + 2470; +return dev_storage + 2598; } } @@ -11218,7 +12397,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st90", 9) == 0) { { -return dev_storage + 2469; +return dev_storage + 2597; } } @@ -11242,7 +12421,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st89", 9) == 0) { { -return dev_storage + 2468; +return dev_storage + 2596; } } @@ -11257,7 +12436,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st88", 9) == 0) { { -return dev_storage + 2467; +return dev_storage + 2595; } } @@ -11272,7 +12451,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st87", 9) == 0) { { -return dev_storage + 2466; +return dev_storage + 2594; } } @@ -11287,7 +12466,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st86", 9) == 0) { { -return dev_storage + 2465; +return dev_storage + 2593; } } @@ -11302,7 +12481,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st85", 9) == 0) { { -return dev_storage + 2464; +return dev_storage + 2592; } } @@ -11317,7 +12496,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st84", 9) == 0) { { -return dev_storage + 2463; +return dev_storage + 2591; } } @@ -11332,7 +12511,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st83", 9) == 0) { { -return dev_storage + 2462; +return dev_storage + 2590; } } @@ -11347,7 +12526,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st82", 9) == 0) { { -return dev_storage + 2461; +return dev_storage + 2589; } } @@ -11362,7 +12541,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st81", 9) == 0) { { -return dev_storage + 2460; +return dev_storage + 2588; } } @@ -11377,7 +12556,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st80", 9) == 0) { { -return dev_storage + 2459; +return dev_storage + 2587; } } @@ -11401,7 +12580,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st79", 9) == 0) { { -return dev_storage + 2458; +return dev_storage + 2586; } } @@ -11416,7 +12595,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st78", 9) == 0) { { -return dev_storage + 2457; +return dev_storage + 2585; } } @@ -11431,7 +12610,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st77", 9) == 0) { { -return dev_storage + 2456; +return dev_storage + 2584; } } @@ -11446,7 +12625,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st76", 9) == 0) { { -return dev_storage + 2455; +return dev_storage + 2583; } } @@ -11461,7 +12640,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st75", 9) == 0) { { -return dev_storage + 2454; +return dev_storage + 2582; } } @@ -11476,7 +12655,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st74", 9) == 0) { { -return dev_storage + 2453; +return dev_storage + 2581; } } @@ -11491,7 +12670,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st73", 9) == 0) { { -return dev_storage + 2452; +return dev_storage + 2580; } } @@ -11506,7 +12685,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st72", 9) == 0) { { -return dev_storage + 2451; +return dev_storage + 2579; } } @@ -11521,7 +12700,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st71", 9) == 0) { { -return dev_storage + 2450; +return dev_storage + 2578; } } @@ -11536,7 +12715,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st70", 9) == 0) { { -return dev_storage + 2449; +return dev_storage + 2577; } } @@ -11560,7 +12739,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st69", 9) == 0) { { -return dev_storage + 2448; +return dev_storage + 2576; } } @@ -11575,7 +12754,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st68", 9) == 0) { { -return dev_storage + 2447; +return dev_storage + 2575; } } @@ -11590,7 +12769,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st67", 9) == 0) { { -return dev_storage + 2446; +return dev_storage + 2574; } } @@ -11605,7 +12784,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st66", 9) == 0) { { -return dev_storage + 2445; +return dev_storage + 2573; } } @@ -11620,7 +12799,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st65", 9) == 0) { { -return dev_storage + 2444; +return dev_storage + 2572; } } @@ -11635,7 +12814,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st64", 9) == 0) { { -return dev_storage + 2443; +return dev_storage + 2571; } } @@ -11650,7 +12829,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st63", 9) == 0) { { -return dev_storage + 2442; +return dev_storage + 2570; } } @@ -11665,7 +12844,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st62", 9) == 0) { { -return dev_storage + 2441; +return dev_storage + 2569; } } @@ -11680,7 +12859,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st61", 9) == 0) { { -return dev_storage + 2440; +return dev_storage + 2568; } } @@ -11695,7 +12874,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st60", 9) == 0) { { -return dev_storage + 2439; +return dev_storage + 2567; } } @@ -11719,7 +12898,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st59", 9) == 0) { { -return dev_storage + 2438; +return dev_storage + 2566; } } @@ -11734,7 +12913,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st58", 9) == 0) { { -return dev_storage + 2437; +return dev_storage + 2565; } } @@ -11749,7 +12928,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st57", 9) == 0) { { -return dev_storage + 2436; +return dev_storage + 2564; } } @@ -11764,7 +12943,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st56", 9) == 0) { { -return dev_storage + 2435; +return dev_storage + 2563; } } @@ -11779,7 +12958,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st55", 9) == 0) { { -return dev_storage + 2434; +return dev_storage + 2562; } } @@ -11794,7 +12973,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st54", 9) == 0) { { -return dev_storage + 2433; +return dev_storage + 2561; } } @@ -11809,7 +12988,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st53", 9) == 0) { { -return dev_storage + 2432; +return dev_storage + 2560; } } @@ -11824,7 +13003,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st52", 9) == 0) { { -return dev_storage + 2431; +return dev_storage + 2559; } } @@ -11839,7 +13018,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st51", 9) == 0) { { -return dev_storage + 2430; +return dev_storage + 2558; } } @@ -11854,7 +13033,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st50", 9) == 0) { { -return dev_storage + 2429; +return dev_storage + 2557; } } @@ -11878,7 +13057,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st49", 9) == 0) { { -return dev_storage + 2428; +return dev_storage + 2556; } } @@ -11893,7 +13072,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st48", 9) == 0) { { -return dev_storage + 2427; +return dev_storage + 2555; } } @@ -11908,7 +13087,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st47", 9) == 0) { { -return dev_storage + 2426; +return dev_storage + 2554; } } @@ -11923,7 +13102,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st46", 9) == 0) { { -return dev_storage + 2425; +return dev_storage + 2553; } } @@ -11938,7 +13117,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st45", 9) == 0) { { -return dev_storage + 2424; +return dev_storage + 2552; } } @@ -11953,7 +13132,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st44", 9) == 0) { { -return dev_storage + 2423; +return dev_storage + 2551; } } @@ -11968,7 +13147,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st43", 9) == 0) { { -return dev_storage + 2422; +return dev_storage + 2550; } } @@ -11983,7 +13162,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st42", 9) == 0) { { -return dev_storage + 2421; +return dev_storage + 2549; } } @@ -11998,7 +13177,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st41", 9) == 0) { { -return dev_storage + 2420; +return dev_storage + 2548; } } @@ -12013,7 +13192,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st40", 9) == 0) { { -return dev_storage + 2419; +return dev_storage + 2547; } } @@ -12037,7 +13216,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st39", 9) == 0) { { -return dev_storage + 2418; +return dev_storage + 2546; } } @@ -12052,7 +13231,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st38", 9) == 0) { { -return dev_storage + 2417; +return dev_storage + 2545; } } @@ -12067,7 +13246,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st37", 9) == 0) { { -return dev_storage + 2416; +return dev_storage + 2544; } } @@ -12082,7 +13261,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st36", 9) == 0) { { -return dev_storage + 2415; +return dev_storage + 2543; } } @@ -12097,7 +13276,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st35", 9) == 0) { { -return dev_storage + 2414; +return dev_storage + 2542; } } @@ -12112,7 +13291,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st34", 9) == 0) { { -return dev_storage + 2413; +return dev_storage + 2541; } } @@ -12127,7 +13306,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st33", 9) == 0) { { -return dev_storage + 2412; +return dev_storage + 2540; } } @@ -12142,7 +13321,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st32", 9) == 0) { { -return dev_storage + 2411; +return dev_storage + 2539; } } @@ -12157,7 +13336,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st31", 9) == 0) { { -return dev_storage + 2410; +return dev_storage + 2538; } } @@ -12172,7 +13351,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st30", 9) == 0) { { -return dev_storage + 2409; +return dev_storage + 2537; } } @@ -12196,7 +13375,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st29", 9) == 0) { { -return dev_storage + 2408; +return dev_storage + 2536; } } @@ -12211,7 +13390,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st28", 9) == 0) { { -return dev_storage + 2407; +return dev_storage + 2535; } } @@ -12226,7 +13405,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st27", 9) == 0) { { -return dev_storage + 2406; +return dev_storage + 2534; } } @@ -12241,7 +13420,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st26", 9) == 0) { { -return dev_storage + 2405; +return dev_storage + 2533; } } @@ -12256,7 +13435,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st25", 9) == 0) { { -return dev_storage + 2404; +return dev_storage + 2532; } } @@ -12271,7 +13450,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st24", 9) == 0) { { -return dev_storage + 2403; +return dev_storage + 2531; } } @@ -12286,7 +13465,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st23", 9) == 0) { { -return dev_storage + 2402; +return dev_storage + 2530; } } @@ -12301,7 +13480,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st22", 9) == 0) { { -return dev_storage + 2401; +return dev_storage + 2529; } } @@ -12316,7 +13495,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st21", 9) == 0) { { -return dev_storage + 2400; +return dev_storage + 2528; } } @@ -12331,7 +13510,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st20", 9) == 0) { { -return dev_storage + 2399; +return dev_storage + 2527; } } @@ -12355,7 +13534,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st19", 9) == 0) { { -return dev_storage + 2398; +return dev_storage + 2526; } } @@ -12370,7 +13549,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st18", 9) == 0) { { -return dev_storage + 2397; +return dev_storage + 2525; } } @@ -12385,7 +13564,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st17", 9) == 0) { { -return dev_storage + 2396; +return dev_storage + 2524; } } @@ -12400,7 +13579,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st16", 9) == 0) { { -return dev_storage + 2395; +return dev_storage + 2523; } } @@ -12418,7 +13597,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st15", 9) == 0) { { -return dev_storage + 2394; +return dev_storage + 2522; } } @@ -12433,7 +13612,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr15", 9) == 0) { { -return dev_storage + 2378; +return dev_storage + 2506; } } @@ -12448,7 +13627,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd15", 9) == 0) { { -return dev_storage + 101; +return dev_storage + 165; } } @@ -12472,7 +13651,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st14", 9) == 0) { { -return dev_storage + 2393; +return dev_storage + 2521; } } @@ -12487,7 +13666,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr14", 9) == 0) { { -return dev_storage + 2377; +return dev_storage + 2505; } } @@ -12502,7 +13681,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd14", 9) == 0) { { -return dev_storage + 100; +return dev_storage + 164; } } @@ -12526,7 +13705,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st13", 9) == 0) { { -return dev_storage + 2392; +return dev_storage + 2520; } } @@ -12541,7 +13720,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr13", 9) == 0) { { -return dev_storage + 2376; +return dev_storage + 2504; } } @@ -12556,7 +13735,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd13", 9) == 0) { { -return dev_storage + 99; +return dev_storage + 163; } } @@ -12580,7 +13759,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st12", 9) == 0) { { -return dev_storage + 2391; +return dev_storage + 2519; } } @@ -12595,7 +13774,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr12", 9) == 0) { { -return dev_storage + 2375; +return dev_storage + 2503; } } @@ -12610,7 +13789,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd12", 9) == 0) { { -return dev_storage + 98; +return dev_storage + 162; } } @@ -12634,7 +13813,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st11", 9) == 0) { { -return dev_storage + 2390; +return dev_storage + 2518; } } @@ -12649,7 +13828,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr11", 9) == 0) { { -return dev_storage + 2374; +return dev_storage + 2502; } } @@ -12664,7 +13843,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd11", 9) == 0) { { -return dev_storage + 97; +return dev_storage + 161; } } @@ -12688,7 +13867,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st10", 9) == 0) { { -return dev_storage + 2389; +return dev_storage + 2517; } } @@ -12703,7 +13882,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sr10", 9) == 0) { { -return dev_storage + 2373; +return dev_storage + 2501; } } @@ -12718,7 +13897,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/fd10", 9) == 0) { { -return dev_storage + 96; +return dev_storage + 160; } } @@ -12775,7 +13954,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz9", 10) == 0) { { -return dev_storage + 1972; +return dev_storage + 2100; } } @@ -12790,7 +13969,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz9", 10) == 0) { { -return dev_storage + 1556; +return dev_storage + 1684; } } @@ -12805,7 +13984,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz9", 10) == 0) { { -return dev_storage + 1140; +return dev_storage + 1268; } } @@ -12829,7 +14008,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy9", 10) == 0) { { -return dev_storage + 1957; +return dev_storage + 2085; } } @@ -12844,7 +14023,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby9", 10) == 0) { { -return dev_storage + 1541; +return dev_storage + 1669; } } @@ -12859,7 +14038,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday9", 10) == 0) { { -return dev_storage + 1125; +return dev_storage + 1253; } } @@ -12883,7 +14062,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx9", 10) == 0) { { -return dev_storage + 2356; +return dev_storage + 2484; } } @@ -12898,7 +14077,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx9", 10) == 0) { { -return dev_storage + 1942; +return dev_storage + 2070; } } @@ -12913,7 +14092,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx9", 10) == 0) { { -return dev_storage + 1526; +return dev_storage + 1654; } } @@ -12928,7 +14107,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax9", 10) == 0) { { -return dev_storage + 1110; +return dev_storage + 1238; } } @@ -12952,7 +14131,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw9", 10) == 0) { { -return dev_storage + 2341; +return dev_storage + 2469; } } @@ -12967,7 +14146,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw9", 10) == 0) { { -return dev_storage + 1927; +return dev_storage + 2055; } } @@ -12982,7 +14161,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw9", 10) == 0) { { -return dev_storage + 1511; +return dev_storage + 1639; } } @@ -12997,7 +14176,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw9", 10) == 0) { { -return dev_storage + 1095; +return dev_storage + 1223; } } @@ -13021,7 +14200,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv9", 10) == 0) { { -return dev_storage + 2326; +return dev_storage + 2454; } } @@ -13036,7 +14215,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv9", 10) == 0) { { -return dev_storage + 1912; +return dev_storage + 2040; } } @@ -13051,7 +14230,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv9", 10) == 0) { { -return dev_storage + 1496; +return dev_storage + 1624; } } @@ -13066,7 +14245,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav9", 10) == 0) { { -return dev_storage + 1080; +return dev_storage + 1208; } } @@ -13090,7 +14269,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu9", 10) == 0) { { -return dev_storage + 2311; +return dev_storage + 2439; } } @@ -13105,7 +14284,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu9", 10) == 0) { { -return dev_storage + 1897; +return dev_storage + 2025; } } @@ -13120,7 +14299,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu9", 10) == 0) { { -return dev_storage + 1481; +return dev_storage + 1609; } } @@ -13135,7 +14314,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau9", 10) == 0) { { -return dev_storage + 1065; +return dev_storage + 1193; } } @@ -13159,7 +14338,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt9", 10) == 0) { { -return dev_storage + 2296; +return dev_storage + 2424; } } @@ -13174,7 +14353,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct9", 10) == 0) { { -return dev_storage + 1882; +return dev_storage + 2010; } } @@ -13189,7 +14368,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt9", 10) == 0) { { -return dev_storage + 1466; +return dev_storage + 1594; } } @@ -13204,7 +14383,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat9", 10) == 0) { { -return dev_storage + 1050; +return dev_storage + 1178; } } @@ -13243,7 +14422,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds9", 10) == 0) { { -return dev_storage + 2281; +return dev_storage + 2409; } } @@ -13258,7 +14437,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs9", 10) == 0) { { -return dev_storage + 1867; +return dev_storage + 1995; } } @@ -13273,7 +14452,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs9", 10) == 0) { { -return dev_storage + 1451; +return dev_storage + 1579; } } @@ -13288,7 +14467,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas9", 10) == 0) { { -return dev_storage + 1035; +return dev_storage + 1163; } } @@ -13312,7 +14491,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr9", 10) == 0) { { -return dev_storage + 2266; +return dev_storage + 2394; } } @@ -13327,7 +14506,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr9", 10) == 0) { { -return dev_storage + 1852; +return dev_storage + 1980; } } @@ -13342,7 +14521,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr9", 10) == 0) { { -return dev_storage + 1436; +return dev_storage + 1564; } } @@ -13357,7 +14536,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar9", 10) == 0) { { -return dev_storage + 1020; +return dev_storage + 1148; } } @@ -13381,7 +14560,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq9", 10) == 0) { { -return dev_storage + 2251; +return dev_storage + 2379; } } @@ -13396,7 +14575,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq9", 10) == 0) { { -return dev_storage + 1837; +return dev_storage + 1965; } } @@ -13411,7 +14590,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq9", 10) == 0) { { -return dev_storage + 1421; +return dev_storage + 1549; } } @@ -13426,7 +14605,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq9", 10) == 0) { { -return dev_storage + 1005; +return dev_storage + 1133; } } @@ -13450,7 +14629,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp9", 10) == 0) { { -return dev_storage + 2236; +return dev_storage + 2364; } } @@ -13465,7 +14644,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp9", 10) == 0) { { -return dev_storage + 1822; +return dev_storage + 1950; } } @@ -13480,7 +14659,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp9", 10) == 0) { { -return dev_storage + 1406; +return dev_storage + 1534; } } @@ -13495,7 +14674,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap9", 10) == 0) { { -return dev_storage + 990; +return dev_storage + 1118; } } @@ -13519,7 +14698,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo9", 10) == 0) { { -return dev_storage + 2221; +return dev_storage + 2349; } } @@ -13534,7 +14713,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco9", 10) == 0) { { -return dev_storage + 1807; +return dev_storage + 1935; } } @@ -13549,7 +14728,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo9", 10) == 0) { { -return dev_storage + 1391; +return dev_storage + 1519; } } @@ -13564,7 +14743,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao9", 10) == 0) { { -return dev_storage + 975; +return dev_storage + 1103; } } @@ -13588,7 +14767,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn9", 10) == 0) { { -return dev_storage + 2206; +return dev_storage + 2334; } } @@ -13603,7 +14782,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn9", 10) == 0) { { -return dev_storage + 1792; +return dev_storage + 1920; } } @@ -13618,7 +14797,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn9", 10) == 0) { { -return dev_storage + 1376; +return dev_storage + 1504; } } @@ -13633,7 +14812,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan9", 10) == 0) { { -return dev_storage + 960; +return dev_storage + 1088; } } @@ -13657,7 +14836,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm9", 10) == 0) { { -return dev_storage + 2191; +return dev_storage + 2319; } } @@ -13672,7 +14851,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm9", 10) == 0) { { -return dev_storage + 1777; +return dev_storage + 1905; } } @@ -13687,7 +14866,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm9", 10) == 0) { { -return dev_storage + 1361; +return dev_storage + 1489; } } @@ -13702,7 +14881,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam9", 10) == 0) { { -return dev_storage + 945; +return dev_storage + 1073; } } @@ -13726,7 +14905,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl9", 10) == 0) { { -return dev_storage + 2176; +return dev_storage + 2304; } } @@ -13741,7 +14920,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl9", 10) == 0) { { -return dev_storage + 1762; +return dev_storage + 1890; } } @@ -13756,7 +14935,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl9", 10) == 0) { { -return dev_storage + 1346; +return dev_storage + 1474; } } @@ -13771,7 +14950,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal9", 10) == 0) { { -return dev_storage + 930; +return dev_storage + 1058; } } @@ -13795,7 +14974,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk9", 10) == 0) { { -return dev_storage + 2161; +return dev_storage + 2289; } } @@ -13810,7 +14989,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck9", 10) == 0) { { -return dev_storage + 1747; +return dev_storage + 1875; } } @@ -13825,7 +15004,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk9", 10) == 0) { { -return dev_storage + 1331; +return dev_storage + 1459; } } @@ -13840,7 +15019,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak9", 10) == 0) { { -return dev_storage + 915; +return dev_storage + 1043; } } @@ -13864,7 +15043,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj9", 10) == 0) { { -return dev_storage + 2146; +return dev_storage + 2274; } } @@ -13879,7 +15058,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj9", 10) == 0) { { -return dev_storage + 1732; +return dev_storage + 1860; } } @@ -13894,7 +15073,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj9", 10) == 0) { { -return dev_storage + 1316; +return dev_storage + 1444; } } @@ -13909,7 +15088,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj9", 10) == 0) { { -return dev_storage + 900; +return dev_storage + 1028; } } @@ -13933,7 +15112,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi9", 10) == 0) { { -return dev_storage + 2131; +return dev_storage + 2259; } } @@ -13948,7 +15127,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci9", 10) == 0) { { -return dev_storage + 1717; +return dev_storage + 1845; } } @@ -13963,7 +15142,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi9", 10) == 0) { { -return dev_storage + 1301; +return dev_storage + 1429; } } @@ -13978,7 +15157,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai9", 10) == 0) { { -return dev_storage + 885; +return dev_storage + 1013; } } @@ -14002,7 +15181,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh9", 10) == 0) { { -return dev_storage + 2116; +return dev_storage + 2244; } } @@ -14017,7 +15196,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch9", 10) == 0) { { -return dev_storage + 1702; +return dev_storage + 1830; } } @@ -14032,7 +15211,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh9", 10) == 0) { { -return dev_storage + 1286; +return dev_storage + 1414; } } @@ -14047,7 +15226,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah9", 10) == 0) { { -return dev_storage + 870; +return dev_storage + 998; } } @@ -14071,7 +15250,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg9", 10) == 0) { { -return dev_storage + 2101; +return dev_storage + 2229; } } @@ -14086,7 +15265,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg9", 10) == 0) { { -return dev_storage + 1687; +return dev_storage + 1815; } } @@ -14101,7 +15280,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg9", 10) == 0) { { -return dev_storage + 1271; +return dev_storage + 1399; } } @@ -14116,7 +15295,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag9", 10) == 0) { { -return dev_storage + 855; +return dev_storage + 983; } } @@ -14140,7 +15319,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf9", 10) == 0) { { -return dev_storage + 2086; +return dev_storage + 2214; } } @@ -14155,7 +15334,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf9", 10) == 0) { { -return dev_storage + 1672; +return dev_storage + 1800; } } @@ -14170,7 +15349,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf9", 10) == 0) { { -return dev_storage + 1256; +return dev_storage + 1384; } } @@ -14185,7 +15364,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf9", 10) == 0) { { -return dev_storage + 840; +return dev_storage + 968; } } @@ -14209,7 +15388,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde9", 10) == 0) { { -return dev_storage + 2071; +return dev_storage + 2199; } } @@ -14224,7 +15403,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce9", 10) == 0) { { -return dev_storage + 1657; +return dev_storage + 1785; } } @@ -14239,7 +15418,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe9", 10) == 0) { { -return dev_storage + 1241; +return dev_storage + 1369; } } @@ -14254,7 +15433,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae9", 10) == 0) { { -return dev_storage + 825; +return dev_storage + 953; } } @@ -14278,7 +15457,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd9", 10) == 0) { { -return dev_storage + 2056; +return dev_storage + 2184; } } @@ -14293,7 +15472,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd9", 10) == 0) { { -return dev_storage + 1642; +return dev_storage + 1770; } } @@ -14308,7 +15487,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd9", 10) == 0) { { -return dev_storage + 1226; +return dev_storage + 1354; } } @@ -14323,7 +15502,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad9", 10) == 0) { { -return dev_storage + 810; +return dev_storage + 938; } } @@ -14347,7 +15526,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc9", 10) == 0) { { -return dev_storage + 2041; +return dev_storage + 2169; } } @@ -14362,7 +15541,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc9", 10) == 0) { { -return dev_storage + 1627; +return dev_storage + 1755; } } @@ -14377,7 +15556,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc9", 10) == 0) { { -return dev_storage + 1211; +return dev_storage + 1339; } } @@ -14392,7 +15571,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac9", 10) == 0) { { -return dev_storage + 795; +return dev_storage + 923; } } @@ -14416,7 +15595,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb9", 10) == 0) { { -return dev_storage + 2026; +return dev_storage + 2154; } } @@ -14431,7 +15610,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb9", 10) == 0) { { -return dev_storage + 1612; +return dev_storage + 1740; } } @@ -14446,7 +15625,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb9", 10) == 0) { { -return dev_storage + 1196; +return dev_storage + 1324; } } @@ -14461,7 +15640,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab9", 10) == 0) { { -return dev_storage + 780; +return dev_storage + 908; } } @@ -14485,7 +15664,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda9", 10) == 0) { { -return dev_storage + 2011; +return dev_storage + 2139; } } @@ -14500,7 +15679,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca9", 10) == 0) { { -return dev_storage + 1597; +return dev_storage + 1725; } } @@ -14515,7 +15694,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba9", 10) == 0) { { -return dev_storage + 1181; +return dev_storage + 1309; } } @@ -14530,7 +15709,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa9", 10) == 0) { { -return dev_storage + 765; +return dev_storage + 893; } } @@ -14551,7 +15730,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS9", 10) == 0) { { -return dev_storage + 2517; +return dev_storage + 2645; } } @@ -14563,60 +15742,156 @@ return NULL; } } case '9': - if (strncmp (KR_keyword, "/dev/nst99", 10) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty99", 10) == 0) + { { -return dev_storage + 203; +return dev_storage + 397; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst99", 10) == 0) + { +{ +return dev_storage + 267; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '8': - if (strncmp (KR_keyword, "/dev/nst89", 10) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty89", 10) == 0) + { { -return dev_storage + 193; +return dev_storage + 387; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst89", 10) == 0) + { +{ +return dev_storage + 257; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '7': - if (strncmp (KR_keyword, "/dev/nst79", 10) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty79", 10) == 0) + { { -return dev_storage + 183; +return dev_storage + 377; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst79", 10) == 0) + { +{ +return dev_storage + 247; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '6': - if (strncmp (KR_keyword, "/dev/nst69", 10) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty69", 10) == 0) + { { -return dev_storage + 173; +return dev_storage + 367; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst69", 10) == 0) + { +{ +return dev_storage + 237; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; @@ -14629,7 +15904,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty59", 10) == 0) { { -return dev_storage + 293; +return dev_storage + 357; } } @@ -14644,7 +15919,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst59", 10) == 0) { { -return dev_storage + 163; +return dev_storage + 227; } } @@ -14668,7 +15943,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty49", 10) == 0) { { -return dev_storage + 283; +return dev_storage + 347; } } @@ -14683,7 +15958,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst49", 10) == 0) { { -return dev_storage + 153; +return dev_storage + 217; } } @@ -14707,7 +15982,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty39", 10) == 0) { { -return dev_storage + 273; +return dev_storage + 337; } } @@ -14722,7 +15997,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst39", 10) == 0) { { -return dev_storage + 143; +return dev_storage + 207; } } @@ -14746,7 +16021,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty29", 10) == 0) { { -return dev_storage + 263; +return dev_storage + 327; } } @@ -14761,7 +16036,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst29", 10) == 0) { { -return dev_storage + 133; +return dev_storage + 197; } } @@ -14785,7 +16060,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st119", 10) == 0) { { -return dev_storage + 2498; +return dev_storage + 2626; } } @@ -14800,7 +16075,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty19", 10) == 0) { { -return dev_storage + 253; +return dev_storage + 317; } } @@ -14815,7 +16090,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst19", 10) == 0) { { -return dev_storage + 123; +return dev_storage + 187; } } @@ -14836,7 +16111,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st109", 10) == 0) { { -return dev_storage + 2488; +return dev_storage + 2616; } } @@ -14863,7 +16138,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz8", 10) == 0) { { -return dev_storage + 1971; +return dev_storage + 2099; } } @@ -14878,7 +16153,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz8", 10) == 0) { { -return dev_storage + 1555; +return dev_storage + 1683; } } @@ -14893,7 +16168,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz8", 10) == 0) { { -return dev_storage + 1139; +return dev_storage + 1267; } } @@ -14917,7 +16192,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy8", 10) == 0) { { -return dev_storage + 1956; +return dev_storage + 2084; } } @@ -14932,7 +16207,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby8", 10) == 0) { { -return dev_storage + 1540; +return dev_storage + 1668; } } @@ -14947,7 +16222,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday8", 10) == 0) { { -return dev_storage + 1124; +return dev_storage + 1252; } } @@ -14971,7 +16246,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx8", 10) == 0) { { -return dev_storage + 2355; +return dev_storage + 2483; } } @@ -14986,7 +16261,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx8", 10) == 0) { { -return dev_storage + 1941; +return dev_storage + 2069; } } @@ -15001,7 +16276,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx8", 10) == 0) { { -return dev_storage + 1525; +return dev_storage + 1653; } } @@ -15016,7 +16291,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax8", 10) == 0) { { -return dev_storage + 1109; +return dev_storage + 1237; } } @@ -15040,7 +16315,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw8", 10) == 0) { { -return dev_storage + 2340; +return dev_storage + 2468; } } @@ -15055,7 +16330,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw8", 10) == 0) { { -return dev_storage + 1926; +return dev_storage + 2054; } } @@ -15070,7 +16345,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw8", 10) == 0) { { -return dev_storage + 1510; +return dev_storage + 1638; } } @@ -15085,7 +16360,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw8", 10) == 0) { { -return dev_storage + 1094; +return dev_storage + 1222; } } @@ -15109,7 +16384,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv8", 10) == 0) { { -return dev_storage + 2325; +return dev_storage + 2453; } } @@ -15124,7 +16399,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv8", 10) == 0) { { -return dev_storage + 1911; +return dev_storage + 2039; } } @@ -15139,7 +16414,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv8", 10) == 0) { { -return dev_storage + 1495; +return dev_storage + 1623; } } @@ -15154,7 +16429,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav8", 10) == 0) { { -return dev_storage + 1079; +return dev_storage + 1207; } } @@ -15178,7 +16453,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu8", 10) == 0) { { -return dev_storage + 2310; +return dev_storage + 2438; } } @@ -15193,7 +16468,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu8", 10) == 0) { { -return dev_storage + 1896; +return dev_storage + 2024; } } @@ -15208,7 +16483,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu8", 10) == 0) { { -return dev_storage + 1480; +return dev_storage + 1608; } } @@ -15223,7 +16498,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau8", 10) == 0) { { -return dev_storage + 1064; +return dev_storage + 1192; } } @@ -15247,7 +16522,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt8", 10) == 0) { { -return dev_storage + 2295; +return dev_storage + 2423; } } @@ -15262,7 +16537,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct8", 10) == 0) { { -return dev_storage + 1881; +return dev_storage + 2009; } } @@ -15277,7 +16552,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt8", 10) == 0) { { -return dev_storage + 1465; +return dev_storage + 1593; } } @@ -15292,7 +16567,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat8", 10) == 0) { { -return dev_storage + 1049; +return dev_storage + 1177; } } @@ -15331,7 +16606,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds8", 10) == 0) { { -return dev_storage + 2280; +return dev_storage + 2408; } } @@ -15346,7 +16621,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs8", 10) == 0) { { -return dev_storage + 1866; +return dev_storage + 1994; } } @@ -15361,7 +16636,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs8", 10) == 0) { { -return dev_storage + 1450; +return dev_storage + 1578; } } @@ -15376,7 +16651,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas8", 10) == 0) { { -return dev_storage + 1034; +return dev_storage + 1162; } } @@ -15400,7 +16675,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr8", 10) == 0) { { -return dev_storage + 2265; +return dev_storage + 2393; } } @@ -15415,7 +16690,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr8", 10) == 0) { { -return dev_storage + 1851; +return dev_storage + 1979; } } @@ -15430,7 +16705,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr8", 10) == 0) { { -return dev_storage + 1435; +return dev_storage + 1563; } } @@ -15445,7 +16720,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar8", 10) == 0) { { -return dev_storage + 1019; +return dev_storage + 1147; } } @@ -15469,7 +16744,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq8", 10) == 0) { { -return dev_storage + 2250; +return dev_storage + 2378; } } @@ -15484,7 +16759,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq8", 10) == 0) { { -return dev_storage + 1836; +return dev_storage + 1964; } } @@ -15499,7 +16774,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq8", 10) == 0) { { -return dev_storage + 1420; +return dev_storage + 1548; } } @@ -15514,7 +16789,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq8", 10) == 0) { { -return dev_storage + 1004; +return dev_storage + 1132; } } @@ -15538,7 +16813,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp8", 10) == 0) { { -return dev_storage + 2235; +return dev_storage + 2363; } } @@ -15553,7 +16828,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp8", 10) == 0) { { -return dev_storage + 1821; +return dev_storage + 1949; } } @@ -15568,7 +16843,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp8", 10) == 0) { { -return dev_storage + 1405; +return dev_storage + 1533; } } @@ -15583,7 +16858,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap8", 10) == 0) { { -return dev_storage + 989; +return dev_storage + 1117; } } @@ -15607,7 +16882,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo8", 10) == 0) { { -return dev_storage + 2220; +return dev_storage + 2348; } } @@ -15622,7 +16897,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco8", 10) == 0) { { -return dev_storage + 1806; +return dev_storage + 1934; } } @@ -15637,7 +16912,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo8", 10) == 0) { { -return dev_storage + 1390; +return dev_storage + 1518; } } @@ -15652,7 +16927,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao8", 10) == 0) { { -return dev_storage + 974; +return dev_storage + 1102; } } @@ -15676,7 +16951,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn8", 10) == 0) { { -return dev_storage + 2205; +return dev_storage + 2333; } } @@ -15691,7 +16966,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn8", 10) == 0) { { -return dev_storage + 1791; +return dev_storage + 1919; } } @@ -15706,7 +16981,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn8", 10) == 0) { { -return dev_storage + 1375; +return dev_storage + 1503; } } @@ -15721,7 +16996,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan8", 10) == 0) { { -return dev_storage + 959; +return dev_storage + 1087; } } @@ -15745,7 +17020,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm8", 10) == 0) { { -return dev_storage + 2190; +return dev_storage + 2318; } } @@ -15760,7 +17035,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm8", 10) == 0) { { -return dev_storage + 1776; +return dev_storage + 1904; } } @@ -15775,7 +17050,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm8", 10) == 0) { { -return dev_storage + 1360; +return dev_storage + 1488; } } @@ -15790,7 +17065,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam8", 10) == 0) { { -return dev_storage + 944; +return dev_storage + 1072; } } @@ -15814,7 +17089,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl8", 10) == 0) { { -return dev_storage + 2175; +return dev_storage + 2303; } } @@ -15829,7 +17104,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl8", 10) == 0) { { -return dev_storage + 1761; +return dev_storage + 1889; } } @@ -15844,7 +17119,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl8", 10) == 0) { { -return dev_storage + 1345; +return dev_storage + 1473; } } @@ -15859,7 +17134,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal8", 10) == 0) { { -return dev_storage + 929; +return dev_storage + 1057; } } @@ -15883,7 +17158,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk8", 10) == 0) { { -return dev_storage + 2160; +return dev_storage + 2288; } } @@ -15898,7 +17173,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck8", 10) == 0) { { -return dev_storage + 1746; +return dev_storage + 1874; } } @@ -15913,7 +17188,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk8", 10) == 0) { { -return dev_storage + 1330; +return dev_storage + 1458; } } @@ -15928,7 +17203,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak8", 10) == 0) { { -return dev_storage + 914; +return dev_storage + 1042; } } @@ -15952,7 +17227,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj8", 10) == 0) { { -return dev_storage + 2145; +return dev_storage + 2273; } } @@ -15967,7 +17242,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj8", 10) == 0) { { -return dev_storage + 1731; +return dev_storage + 1859; } } @@ -15982,7 +17257,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj8", 10) == 0) { { -return dev_storage + 1315; +return dev_storage + 1443; } } @@ -15997,7 +17272,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj8", 10) == 0) { { -return dev_storage + 899; +return dev_storage + 1027; } } @@ -16021,7 +17296,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi8", 10) == 0) { { -return dev_storage + 2130; +return dev_storage + 2258; } } @@ -16036,7 +17311,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci8", 10) == 0) { { -return dev_storage + 1716; +return dev_storage + 1844; } } @@ -16051,7 +17326,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi8", 10) == 0) { { -return dev_storage + 1300; +return dev_storage + 1428; } } @@ -16066,7 +17341,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai8", 10) == 0) { { -return dev_storage + 884; +return dev_storage + 1012; } } @@ -16090,7 +17365,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh8", 10) == 0) { { -return dev_storage + 2115; +return dev_storage + 2243; } } @@ -16105,7 +17380,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch8", 10) == 0) { { -return dev_storage + 1701; +return dev_storage + 1829; } } @@ -16120,7 +17395,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh8", 10) == 0) { { -return dev_storage + 1285; +return dev_storage + 1413; } } @@ -16135,7 +17410,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah8", 10) == 0) { { -return dev_storage + 869; +return dev_storage + 997; } } @@ -16159,7 +17434,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg8", 10) == 0) { { -return dev_storage + 2100; +return dev_storage + 2228; } } @@ -16174,7 +17449,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg8", 10) == 0) { { -return dev_storage + 1686; +return dev_storage + 1814; } } @@ -16189,7 +17464,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg8", 10) == 0) { { -return dev_storage + 1270; +return dev_storage + 1398; } } @@ -16204,7 +17479,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag8", 10) == 0) { { -return dev_storage + 854; +return dev_storage + 982; } } @@ -16228,7 +17503,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf8", 10) == 0) { { -return dev_storage + 2085; +return dev_storage + 2213; } } @@ -16243,7 +17518,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf8", 10) == 0) { { -return dev_storage + 1671; +return dev_storage + 1799; } } @@ -16258,7 +17533,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf8", 10) == 0) { { -return dev_storage + 1255; +return dev_storage + 1383; } } @@ -16273,7 +17548,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf8", 10) == 0) { { -return dev_storage + 839; +return dev_storage + 967; } } @@ -16297,7 +17572,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde8", 10) == 0) { { -return dev_storage + 2070; +return dev_storage + 2198; } } @@ -16312,7 +17587,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce8", 10) == 0) { { -return dev_storage + 1656; +return dev_storage + 1784; } } @@ -16327,7 +17602,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe8", 10) == 0) { { -return dev_storage + 1240; +return dev_storage + 1368; } } @@ -16342,7 +17617,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae8", 10) == 0) { { -return dev_storage + 824; +return dev_storage + 952; } } @@ -16366,7 +17641,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd8", 10) == 0) { { -return dev_storage + 2055; +return dev_storage + 2183; } } @@ -16381,7 +17656,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd8", 10) == 0) { { -return dev_storage + 1641; +return dev_storage + 1769; } } @@ -16396,7 +17671,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd8", 10) == 0) { { -return dev_storage + 1225; +return dev_storage + 1353; } } @@ -16411,7 +17686,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad8", 10) == 0) { { -return dev_storage + 809; +return dev_storage + 937; } } @@ -16435,7 +17710,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc8", 10) == 0) { { -return dev_storage + 2040; +return dev_storage + 2168; } } @@ -16450,7 +17725,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc8", 10) == 0) { { -return dev_storage + 1626; +return dev_storage + 1754; } } @@ -16465,7 +17740,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc8", 10) == 0) { { -return dev_storage + 1210; +return dev_storage + 1338; } } @@ -16480,7 +17755,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac8", 10) == 0) { { -return dev_storage + 794; +return dev_storage + 922; } } @@ -16504,7 +17779,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb8", 10) == 0) { { -return dev_storage + 2025; +return dev_storage + 2153; } } @@ -16519,7 +17794,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb8", 10) == 0) { { -return dev_storage + 1611; +return dev_storage + 1739; } } @@ -16534,7 +17809,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb8", 10) == 0) { { -return dev_storage + 1195; +return dev_storage + 1323; } } @@ -16549,7 +17824,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab8", 10) == 0) { { -return dev_storage + 779; +return dev_storage + 907; } } @@ -16573,7 +17848,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda8", 10) == 0) { { -return dev_storage + 2010; +return dev_storage + 2138; } } @@ -16588,7 +17863,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca8", 10) == 0) { { -return dev_storage + 1596; +return dev_storage + 1724; } } @@ -16603,7 +17878,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba8", 10) == 0) { { -return dev_storage + 1180; +return dev_storage + 1308; } } @@ -16618,7 +17893,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa8", 10) == 0) { { -return dev_storage + 764; +return dev_storage + 892; } } @@ -16639,7 +17914,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS8", 10) == 0) { { -return dev_storage + 2516; +return dev_storage + 2644; } } @@ -16651,60 +17926,156 @@ return NULL; } } case '9': - if (strncmp (KR_keyword, "/dev/nst98", 10) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty98", 10) == 0) + { { -return dev_storage + 202; +return dev_storage + 396; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst98", 10) == 0) + { +{ +return dev_storage + 266; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '8': - if (strncmp (KR_keyword, "/dev/nst88", 10) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty88", 10) == 0) + { { -return dev_storage + 192; +return dev_storage + 386; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst88", 10) == 0) + { +{ +return dev_storage + 256; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '7': - if (strncmp (KR_keyword, "/dev/nst78", 10) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty78", 10) == 0) + { { -return dev_storage + 182; +return dev_storage + 376; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst78", 10) == 0) + { +{ +return dev_storage + 246; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '6': - if (strncmp (KR_keyword, "/dev/nst68", 10) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty68", 10) == 0) + { { -return dev_storage + 172; +return dev_storage + 366; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst68", 10) == 0) + { +{ +return dev_storage + 236; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; @@ -16717,7 +18088,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty58", 10) == 0) { { -return dev_storage + 292; +return dev_storage + 356; } } @@ -16732,7 +18103,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst58", 10) == 0) { { -return dev_storage + 162; +return dev_storage + 226; } } @@ -16756,7 +18127,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty48", 10) == 0) { { -return dev_storage + 282; +return dev_storage + 346; } } @@ -16771,7 +18142,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst48", 10) == 0) { { -return dev_storage + 152; +return dev_storage + 216; } } @@ -16795,7 +18166,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty38", 10) == 0) { { -return dev_storage + 272; +return dev_storage + 336; } } @@ -16810,7 +18181,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst38", 10) == 0) { { -return dev_storage + 142; +return dev_storage + 206; } } @@ -16834,7 +18205,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty28", 10) == 0) { { -return dev_storage + 262; +return dev_storage + 326; } } @@ -16849,7 +18220,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst28", 10) == 0) { { -return dev_storage + 132; +return dev_storage + 196; } } @@ -16873,7 +18244,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st118", 10) == 0) { { -return dev_storage + 2497; +return dev_storage + 2625; } } @@ -16888,7 +18259,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty18", 10) == 0) { { -return dev_storage + 252; +return dev_storage + 316; } } @@ -16903,7 +18274,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst18", 10) == 0) { { -return dev_storage + 122; +return dev_storage + 186; } } @@ -16924,7 +18295,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st108", 10) == 0) { { -return dev_storage + 2487; +return dev_storage + 2615; } } @@ -16951,7 +18322,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz7", 10) == 0) { { -return dev_storage + 1970; +return dev_storage + 2098; } } @@ -16966,7 +18337,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz7", 10) == 0) { { -return dev_storage + 1554; +return dev_storage + 1682; } } @@ -16981,7 +18352,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz7", 10) == 0) { { -return dev_storage + 1138; +return dev_storage + 1266; } } @@ -17005,7 +18376,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy7", 10) == 0) { { -return dev_storage + 1955; +return dev_storage + 2083; } } @@ -17020,7 +18391,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby7", 10) == 0) { { -return dev_storage + 1539; +return dev_storage + 1667; } } @@ -17035,7 +18406,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday7", 10) == 0) { { -return dev_storage + 1123; +return dev_storage + 1251; } } @@ -17059,7 +18430,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx7", 10) == 0) { { -return dev_storage + 2354; +return dev_storage + 2482; } } @@ -17074,7 +18445,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx7", 10) == 0) { { -return dev_storage + 1940; +return dev_storage + 2068; } } @@ -17089,7 +18460,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx7", 10) == 0) { { -return dev_storage + 1524; +return dev_storage + 1652; } } @@ -17104,7 +18475,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax7", 10) == 0) { { -return dev_storage + 1108; +return dev_storage + 1236; } } @@ -17128,7 +18499,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw7", 10) == 0) { { -return dev_storage + 2339; +return dev_storage + 2467; } } @@ -17143,7 +18514,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw7", 10) == 0) { { -return dev_storage + 1925; +return dev_storage + 2053; } } @@ -17158,7 +18529,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw7", 10) == 0) { { -return dev_storage + 1509; +return dev_storage + 1637; } } @@ -17173,7 +18544,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw7", 10) == 0) { { -return dev_storage + 1093; +return dev_storage + 1221; } } @@ -17197,7 +18568,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv7", 10) == 0) { { -return dev_storage + 2324; +return dev_storage + 2452; } } @@ -17212,7 +18583,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv7", 10) == 0) { { -return dev_storage + 1910; +return dev_storage + 2038; } } @@ -17227,7 +18598,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv7", 10) == 0) { { -return dev_storage + 1494; +return dev_storage + 1622; } } @@ -17242,7 +18613,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav7", 10) == 0) { { -return dev_storage + 1078; +return dev_storage + 1206; } } @@ -17266,7 +18637,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu7", 10) == 0) { { -return dev_storage + 2309; +return dev_storage + 2437; } } @@ -17281,7 +18652,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu7", 10) == 0) { { -return dev_storage + 1895; +return dev_storage + 2023; } } @@ -17296,7 +18667,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu7", 10) == 0) { { -return dev_storage + 1479; +return dev_storage + 1607; } } @@ -17311,7 +18682,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau7", 10) == 0) { { -return dev_storage + 1063; +return dev_storage + 1191; } } @@ -17335,7 +18706,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt7", 10) == 0) { { -return dev_storage + 2294; +return dev_storage + 2422; } } @@ -17350,7 +18721,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct7", 10) == 0) { { -return dev_storage + 1880; +return dev_storage + 2008; } } @@ -17365,7 +18736,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt7", 10) == 0) { { -return dev_storage + 1464; +return dev_storage + 1592; } } @@ -17380,7 +18751,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat7", 10) == 0) { { -return dev_storage + 1048; +return dev_storage + 1176; } } @@ -17419,7 +18790,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds7", 10) == 0) { { -return dev_storage + 2279; +return dev_storage + 2407; } } @@ -17434,7 +18805,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs7", 10) == 0) { { -return dev_storage + 1865; +return dev_storage + 1993; } } @@ -17449,7 +18820,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs7", 10) == 0) { { -return dev_storage + 1449; +return dev_storage + 1577; } } @@ -17464,7 +18835,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas7", 10) == 0) { { -return dev_storage + 1033; +return dev_storage + 1161; } } @@ -17488,7 +18859,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr7", 10) == 0) { { -return dev_storage + 2264; +return dev_storage + 2392; } } @@ -17503,7 +18874,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr7", 10) == 0) { { -return dev_storage + 1850; +return dev_storage + 1978; } } @@ -17518,7 +18889,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr7", 10) == 0) { { -return dev_storage + 1434; +return dev_storage + 1562; } } @@ -17533,7 +18904,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar7", 10) == 0) { { -return dev_storage + 1018; +return dev_storage + 1146; } } @@ -17557,7 +18928,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq7", 10) == 0) { { -return dev_storage + 2249; +return dev_storage + 2377; } } @@ -17572,7 +18943,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq7", 10) == 0) { { -return dev_storage + 1835; +return dev_storage + 1963; } } @@ -17587,7 +18958,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq7", 10) == 0) { { -return dev_storage + 1419; +return dev_storage + 1547; } } @@ -17602,7 +18973,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq7", 10) == 0) { { -return dev_storage + 1003; +return dev_storage + 1131; } } @@ -17626,7 +18997,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp7", 10) == 0) { { -return dev_storage + 2234; +return dev_storage + 2362; } } @@ -17641,7 +19012,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp7", 10) == 0) { { -return dev_storage + 1820; +return dev_storage + 1948; } } @@ -17656,7 +19027,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp7", 10) == 0) { { -return dev_storage + 1404; +return dev_storage + 1532; } } @@ -17671,7 +19042,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap7", 10) == 0) { { -return dev_storage + 988; +return dev_storage + 1116; } } @@ -17695,7 +19066,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo7", 10) == 0) { { -return dev_storage + 2219; +return dev_storage + 2347; } } @@ -17710,7 +19081,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco7", 10) == 0) { { -return dev_storage + 1805; +return dev_storage + 1933; } } @@ -17725,7 +19096,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo7", 10) == 0) { { -return dev_storage + 1389; +return dev_storage + 1517; } } @@ -17740,7 +19111,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao7", 10) == 0) { { -return dev_storage + 973; +return dev_storage + 1101; } } @@ -17764,7 +19135,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn7", 10) == 0) { { -return dev_storage + 2204; +return dev_storage + 2332; } } @@ -17779,7 +19150,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn7", 10) == 0) { { -return dev_storage + 1790; +return dev_storage + 1918; } } @@ -17794,7 +19165,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn7", 10) == 0) { { -return dev_storage + 1374; +return dev_storage + 1502; } } @@ -17809,7 +19180,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan7", 10) == 0) { { -return dev_storage + 958; +return dev_storage + 1086; } } @@ -17833,7 +19204,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm7", 10) == 0) { { -return dev_storage + 2189; +return dev_storage + 2317; } } @@ -17848,7 +19219,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm7", 10) == 0) { { -return dev_storage + 1775; +return dev_storage + 1903; } } @@ -17863,7 +19234,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm7", 10) == 0) { { -return dev_storage + 1359; +return dev_storage + 1487; } } @@ -17878,7 +19249,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam7", 10) == 0) { { -return dev_storage + 943; +return dev_storage + 1071; } } @@ -17902,7 +19273,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl7", 10) == 0) { { -return dev_storage + 2174; +return dev_storage + 2302; } } @@ -17917,7 +19288,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl7", 10) == 0) { { -return dev_storage + 1760; +return dev_storage + 1888; } } @@ -17932,7 +19303,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl7", 10) == 0) { { -return dev_storage + 1344; +return dev_storage + 1472; } } @@ -17947,7 +19318,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal7", 10) == 0) { { -return dev_storage + 928; +return dev_storage + 1056; } } @@ -17971,7 +19342,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk7", 10) == 0) { { -return dev_storage + 2159; +return dev_storage + 2287; } } @@ -17986,7 +19357,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck7", 10) == 0) { { -return dev_storage + 1745; +return dev_storage + 1873; } } @@ -18001,7 +19372,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk7", 10) == 0) { { -return dev_storage + 1329; +return dev_storage + 1457; } } @@ -18016,7 +19387,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak7", 10) == 0) { { -return dev_storage + 913; +return dev_storage + 1041; } } @@ -18040,7 +19411,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj7", 10) == 0) { { -return dev_storage + 2144; +return dev_storage + 2272; } } @@ -18055,7 +19426,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj7", 10) == 0) { { -return dev_storage + 1730; +return dev_storage + 1858; } } @@ -18070,7 +19441,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj7", 10) == 0) { { -return dev_storage + 1314; +return dev_storage + 1442; } } @@ -18085,7 +19456,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj7", 10) == 0) { { -return dev_storage + 898; +return dev_storage + 1026; } } @@ -18109,7 +19480,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi7", 10) == 0) { { -return dev_storage + 2129; +return dev_storage + 2257; } } @@ -18124,7 +19495,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci7", 10) == 0) { { -return dev_storage + 1715; +return dev_storage + 1843; } } @@ -18139,7 +19510,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi7", 10) == 0) { { -return dev_storage + 1299; +return dev_storage + 1427; } } @@ -18154,7 +19525,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai7", 10) == 0) { { -return dev_storage + 883; +return dev_storage + 1011; } } @@ -18178,7 +19549,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh7", 10) == 0) { { -return dev_storage + 2114; +return dev_storage + 2242; } } @@ -18193,7 +19564,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch7", 10) == 0) { { -return dev_storage + 1700; +return dev_storage + 1828; } } @@ -18208,7 +19579,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh7", 10) == 0) { { -return dev_storage + 1284; +return dev_storage + 1412; } } @@ -18223,7 +19594,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah7", 10) == 0) { { -return dev_storage + 868; +return dev_storage + 996; } } @@ -18247,7 +19618,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg7", 10) == 0) { { -return dev_storage + 2099; +return dev_storage + 2227; } } @@ -18262,7 +19633,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg7", 10) == 0) { { -return dev_storage + 1685; +return dev_storage + 1813; } } @@ -18277,7 +19648,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg7", 10) == 0) { { -return dev_storage + 1269; +return dev_storage + 1397; } } @@ -18292,7 +19663,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag7", 10) == 0) { { -return dev_storage + 853; +return dev_storage + 981; } } @@ -18316,7 +19687,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf7", 10) == 0) { { -return dev_storage + 2084; +return dev_storage + 2212; } } @@ -18331,7 +19702,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf7", 10) == 0) { { -return dev_storage + 1670; +return dev_storage + 1798; } } @@ -18346,7 +19717,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf7", 10) == 0) { { -return dev_storage + 1254; +return dev_storage + 1382; } } @@ -18361,7 +19732,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf7", 10) == 0) { { -return dev_storage + 838; +return dev_storage + 966; } } @@ -18385,7 +19756,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde7", 10) == 0) { { -return dev_storage + 2069; +return dev_storage + 2197; } } @@ -18400,7 +19771,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce7", 10) == 0) { { -return dev_storage + 1655; +return dev_storage + 1783; } } @@ -18415,7 +19786,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe7", 10) == 0) { { -return dev_storage + 1239; +return dev_storage + 1367; } } @@ -18430,7 +19801,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae7", 10) == 0) { { -return dev_storage + 823; +return dev_storage + 951; } } @@ -18454,7 +19825,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd7", 10) == 0) { { -return dev_storage + 2054; +return dev_storage + 2182; } } @@ -18469,7 +19840,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd7", 10) == 0) { { -return dev_storage + 1640; +return dev_storage + 1768; } } @@ -18484,7 +19855,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd7", 10) == 0) { { -return dev_storage + 1224; +return dev_storage + 1352; } } @@ -18499,7 +19870,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad7", 10) == 0) { { -return dev_storage + 808; +return dev_storage + 936; } } @@ -18523,7 +19894,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc7", 10) == 0) { { -return dev_storage + 2039; +return dev_storage + 2167; } } @@ -18538,7 +19909,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc7", 10) == 0) { { -return dev_storage + 1625; +return dev_storage + 1753; } } @@ -18553,7 +19924,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc7", 10) == 0) { { -return dev_storage + 1209; +return dev_storage + 1337; } } @@ -18568,7 +19939,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac7", 10) == 0) { { -return dev_storage + 793; +return dev_storage + 921; } } @@ -18592,7 +19963,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb7", 10) == 0) { { -return dev_storage + 2024; +return dev_storage + 2152; } } @@ -18607,7 +19978,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb7", 10) == 0) { { -return dev_storage + 1610; +return dev_storage + 1738; } } @@ -18622,7 +19993,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb7", 10) == 0) { { -return dev_storage + 1194; +return dev_storage + 1322; } } @@ -18637,7 +20008,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab7", 10) == 0) { { -return dev_storage + 778; +return dev_storage + 906; } } @@ -18661,7 +20032,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda7", 10) == 0) { { -return dev_storage + 2009; +return dev_storage + 2137; } } @@ -18676,7 +20047,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca7", 10) == 0) { { -return dev_storage + 1595; +return dev_storage + 1723; } } @@ -18691,7 +20062,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba7", 10) == 0) { { -return dev_storage + 1179; +return dev_storage + 1307; } } @@ -18706,7 +20077,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa7", 10) == 0) { { -return dev_storage + 763; +return dev_storage + 891; } } @@ -18727,7 +20098,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS7", 10) == 0) { { -return dev_storage + 2515; +return dev_storage + 2643; } } @@ -18739,60 +20110,156 @@ return NULL; } } case '9': - if (strncmp (KR_keyword, "/dev/nst97", 10) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty97", 10) == 0) + { { -return dev_storage + 201; +return dev_storage + 395; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst97", 10) == 0) + { +{ +return dev_storage + 265; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '8': - if (strncmp (KR_keyword, "/dev/nst87", 10) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty87", 10) == 0) + { { -return dev_storage + 191; +return dev_storage + 385; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst87", 10) == 0) + { +{ +return dev_storage + 255; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '7': - if (strncmp (KR_keyword, "/dev/nst77", 10) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty77", 10) == 0) + { { -return dev_storage + 181; +return dev_storage + 375; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst77", 10) == 0) + { +{ +return dev_storage + 245; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '6': - if (strncmp (KR_keyword, "/dev/nst67", 10) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty67", 10) == 0) + { { -return dev_storage + 171; +return dev_storage + 365; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst67", 10) == 0) + { +{ +return dev_storage + 235; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; @@ -18805,7 +20272,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty57", 10) == 0) { { -return dev_storage + 291; +return dev_storage + 355; } } @@ -18820,7 +20287,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst57", 10) == 0) { { -return dev_storage + 161; +return dev_storage + 225; } } @@ -18844,7 +20311,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty47", 10) == 0) { { -return dev_storage + 281; +return dev_storage + 345; } } @@ -18859,7 +20326,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst47", 10) == 0) { { -return dev_storage + 151; +return dev_storage + 215; } } @@ -18883,7 +20350,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty37", 10) == 0) { { -return dev_storage + 271; +return dev_storage + 335; } } @@ -18898,7 +20365,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst37", 10) == 0) { { -return dev_storage + 141; +return dev_storage + 205; } } @@ -18922,7 +20389,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st127", 10) == 0) { { -return dev_storage + 2506; +return dev_storage + 2634; } } @@ -18937,7 +20404,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty27", 10) == 0) { { -return dev_storage + 261; +return dev_storage + 325; } } @@ -18952,7 +20419,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst27", 10) == 0) { { -return dev_storage + 131; +return dev_storage + 195; } } @@ -18976,7 +20443,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st117", 10) == 0) { { -return dev_storage + 2496; +return dev_storage + 2624; } } @@ -18991,7 +20458,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty17", 10) == 0) { { -return dev_storage + 251; +return dev_storage + 315; } } @@ -19006,7 +20473,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst17", 10) == 0) { { -return dev_storage + 121; +return dev_storage + 185; } } @@ -19027,7 +20494,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st107", 10) == 0) { { -return dev_storage + 2486; +return dev_storage + 2614; } } @@ -19045,70 +20512,16 @@ return NULL; } } case '6': - switch (KR_keyword [8]) + switch (KR_keyword [7]) { - case 'z': - switch (KR_keyword [7]) - { - case 'c': - if (strncmp (KR_keyword, "/dev/sdcz6", 10) == 0) - { -{ -return dev_storage + 1969; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbz6", 10) == 0) - { -{ -return dev_storage + 1553; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdaz6", 10) == 0) - { -{ -return dev_storage + 1137; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } case 'y': - switch (KR_keyword [7]) + switch (KR_keyword [8]) { - case 'c': - if (strncmp (KR_keyword, "/dev/sdcy6", 10) == 0) + case 'S': + if (strncmp (KR_keyword, "/dev/ttyS6", 10) == 0) { { -return dev_storage + 1954; +return dev_storage + 2642; } } @@ -19119,11 +20532,11 @@ return NULL; } } - case 'b': - if (strncmp (KR_keyword, "/dev/sdby6", 10) == 0) + case '9': + if (strncmp (KR_keyword, "/dev/pty96", 10) == 0) { { -return dev_storage + 1538; +return dev_storage + 394; } } @@ -19134,11 +20547,11 @@ return NULL; } } - case 'a': - if (strncmp (KR_keyword, "/dev/sday6", 10) == 0) + case '8': + if (strncmp (KR_keyword, "/dev/pty86", 10) == 0) { { -return dev_storage + 1122; +return dev_storage + 384; } } @@ -19149,20 +20562,11 @@ return NULL; } } - default: -{ -return NULL; - -} - } - case 'x': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sddx6", 10) == 0) + case '7': + if (strncmp (KR_keyword, "/dev/pty76", 10) == 0) { { -return dev_storage + 2353; +return dev_storage + 374; } } @@ -19173,11 +20577,11 @@ return NULL; } } - case 'c': - if (strncmp (KR_keyword, "/dev/sdcx6", 10) == 0) + case '6': + if (strncmp (KR_keyword, "/dev/pty66", 10) == 0) { { -return dev_storage + 1939; +return dev_storage + 364; } } @@ -19188,11 +20592,11 @@ return NULL; } } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbx6", 10) == 0) + case '5': + if (strncmp (KR_keyword, "/dev/pty56", 10) == 0) { { -return dev_storage + 1523; +return dev_storage + 354; } } @@ -19203,11 +20607,11 @@ return NULL; } } - case 'a': - if (strncmp (KR_keyword, "/dev/sdax6", 10) == 0) + case '4': + if (strncmp (KR_keyword, "/dev/pty46", 10) == 0) { { -return dev_storage + 1107; +return dev_storage + 344; } } @@ -19218,20 +20622,11 @@ return NULL; } } - default: -{ -return NULL; - -} - } - case 'w': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sddw6", 10) == 0) + case '3': + if (strncmp (KR_keyword, "/dev/pty36", 10) == 0) { { -return dev_storage + 2338; +return dev_storage + 334; } } @@ -19242,11 +20637,11 @@ return NULL; } } - case 'c': - if (strncmp (KR_keyword, "/dev/sdcw6", 10) == 0) + case '2': + if (strncmp (KR_keyword, "/dev/pty26", 10) == 0) { { -return dev_storage + 1924; +return dev_storage + 324; } } @@ -19257,164 +20652,11 @@ return NULL; } } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbw6", 10) == 0) + case '1': + if (strncmp (KR_keyword, "/dev/pty16", 10) == 0) { { -return dev_storage + 1508; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdaw6", 10) == 0) - { -{ -return dev_storage + 1092; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'v': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sddv6", 10) == 0) - { -{ -return dev_storage + 2323; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdcv6", 10) == 0) - { -{ -return dev_storage + 1909; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbv6", 10) == 0) - { -{ -return dev_storage + 1493; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdav6", 10) == 0) - { -{ -return dev_storage + 1077; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'u': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sddu6", 10) == 0) - { -{ -return dev_storage + 2308; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdcu6", 10) == 0) - { -{ -return dev_storage + 1894; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbu6", 10) == 0) - { -{ -return dev_storage + 1478; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdau6", 10) == 0) - { -{ -return dev_storage + 1062; +return dev_storage + 314; } } @@ -19432,13 +20674,13 @@ return NULL; } } case 't': - switch (KR_keyword [7]) + switch (KR_keyword [8]) { - case 'd': - if (strncmp (KR_keyword, "/dev/sddt6", 10) == 0) + case '9': + if (strncmp (KR_keyword, "/dev/nst96", 10) == 0) { { -return dev_storage + 2293; +return dev_storage + 264; } } @@ -19449,11 +20691,11 @@ return NULL; } } - case 'c': - if (strncmp (KR_keyword, "/dev/sdct6", 10) == 0) + case '8': + if (strncmp (KR_keyword, "/dev/nst86", 10) == 0) { { -return dev_storage + 1879; +return dev_storage + 254; } } @@ -19464,11 +20706,11 @@ return NULL; } } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbt6", 10) == 0) + case '7': + if (strncmp (KR_keyword, "/dev/nst76", 10) == 0) { { -return dev_storage + 1463; +return dev_storage + 244; } } @@ -19479,11 +20721,11 @@ return NULL; } } - case 'a': - if (strncmp (KR_keyword, "/dev/sdat6", 10) == 0) + case '6': + if (strncmp (KR_keyword, "/dev/nst66", 10) == 0) { { -return dev_storage + 1047; +return dev_storage + 234; } } @@ -19494,20 +20736,11 @@ return NULL; } } - default: -{ -return NULL; - -} - } - case 's': - switch (KR_keyword [7]) - { - case 'n': - if (strncmp (KR_keyword, "/dev/cons6", 10) == 0) + case '5': + if (strncmp (KR_keyword, "/dev/nst56", 10) == 0) { { -return dev_storage + 26; +return dev_storage + 224; } } @@ -19518,11 +20751,11 @@ return NULL; } } - case 'd': - if (strncmp (KR_keyword, "/dev/sdds6", 10) == 0) + case '4': + if (strncmp (KR_keyword, "/dev/nst46", 10) == 0) { { -return dev_storage + 2278; +return dev_storage + 214; } } @@ -19533,11 +20766,11 @@ return NULL; } } - case 'c': - if (strncmp (KR_keyword, "/dev/sdcs6", 10) == 0) + case '3': + if (strncmp (KR_keyword, "/dev/nst36", 10) == 0) { { -return dev_storage + 1864; +return dev_storage + 204; } } @@ -19548,11 +20781,11 @@ return NULL; } } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbs6", 10) == 0) + case '2': + if (strncmp (KR_keyword, "/dev/nst26", 10) == 0) { { -return dev_storage + 1448; +return dev_storage + 194; } } @@ -19563,287 +20796,11 @@ return NULL; } } - case 'a': - if (strncmp (KR_keyword, "/dev/sdas6", 10) == 0) + case '1': + if (strncmp (KR_keyword, "/dev/nst16", 10) == 0) { { -return dev_storage + 1032; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'r': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sddr6", 10) == 0) - { -{ -return dev_storage + 2263; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdcr6", 10) == 0) - { -{ -return dev_storage + 1849; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbr6", 10) == 0) - { -{ -return dev_storage + 1433; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdar6", 10) == 0) - { -{ -return dev_storage + 1017; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'q': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sddq6", 10) == 0) - { -{ -return dev_storage + 2248; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdcq6", 10) == 0) - { -{ -return dev_storage + 1834; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbq6", 10) == 0) - { -{ -return dev_storage + 1418; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdaq6", 10) == 0) - { -{ -return dev_storage + 1002; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'p': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sddp6", 10) == 0) - { -{ -return dev_storage + 2233; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdcp6", 10) == 0) - { -{ -return dev_storage + 1819; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbp6", 10) == 0) - { -{ -return dev_storage + 1403; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdap6", 10) == 0) - { -{ -return dev_storage + 987; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'o': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sddo6", 10) == 0) - { -{ -return dev_storage + 2218; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdco6", 10) == 0) - { -{ -return dev_storage + 1804; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbo6", 10) == 0) - { -{ -return dev_storage + 1388; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdao6", 10) == 0) - { -{ -return dev_storage + 972; +return dev_storage + 184; } } @@ -19861,703 +20818,343 @@ return NULL; } } case 'n': - switch (KR_keyword [7]) + if (strncmp (KR_keyword, "/dev/cons6", 10) == 0) { - case 'd': - if (strncmp (KR_keyword, "/dev/sddn6", 10) == 0) - { { -return dev_storage + 2203; +return dev_storage + 26; } - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdcn6", 10) == 0) - { -{ -return dev_storage + 1789; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbn6", 10) == 0) - { -{ -return dev_storage + 1373; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdan6", 10) == 0) - { -{ -return dev_storage + 957; - -} - } - else - { -{ -return NULL; - -} - } - default: + } + else + { { return NULL; } } case 'm': - switch (KR_keyword [7]) + if (strncmp (KR_keyword, "/dev/com16", 10) == 0) { - case 'd': - if (strncmp (KR_keyword, "/dev/sddm6", 10) == 0) - { { -return dev_storage + 2188; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdcm6", 10) == 0) - { -{ -return dev_storage + 1774; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbm6", 10) == 0) - { -{ -return dev_storage + 1358; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdam6", 10) == 0) - { -{ -return dev_storage + 942; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; +return dev_storage + 17; } } - case 'l': - switch (KR_keyword [7]) + else { - case 'd': - if (strncmp (KR_keyword, "/dev/sddl6", 10) == 0) - { -{ -return dev_storage + 2173; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdcl6", 10) == 0) - { -{ -return dev_storage + 1759; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbl6", 10) == 0) - { -{ -return dev_storage + 1343; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdal6", 10) == 0) - { -{ -return dev_storage + 927; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'k': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sddk6", 10) == 0) - { -{ -return dev_storage + 2158; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdck6", 10) == 0) - { -{ -return dev_storage + 1744; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbk6", 10) == 0) - { -{ -return dev_storage + 1328; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdak6", 10) == 0) - { -{ -return dev_storage + 912; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'j': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sddj6", 10) == 0) - { -{ -return dev_storage + 2143; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdcj6", 10) == 0) - { -{ -return dev_storage + 1729; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbj6", 10) == 0) - { -{ -return dev_storage + 1313; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdaj6", 10) == 0) - { -{ -return dev_storage + 897; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'i': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sddi6", 10) == 0) - { -{ -return dev_storage + 2128; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdci6", 10) == 0) - { -{ -return dev_storage + 1714; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbi6", 10) == 0) - { -{ -return dev_storage + 1298; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdai6", 10) == 0) - { -{ -return dev_storage + 882; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'h': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sddh6", 10) == 0) - { -{ -return dev_storage + 2113; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdch6", 10) == 0) - { -{ -return dev_storage + 1699; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbh6", 10) == 0) - { -{ -return dev_storage + 1283; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdah6", 10) == 0) - { -{ -return dev_storage + 867; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'g': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sddg6", 10) == 0) - { -{ -return dev_storage + 2098; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdcg6", 10) == 0) - { -{ -return dev_storage + 1684; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbg6", 10) == 0) - { -{ -return dev_storage + 1268; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdag6", 10) == 0) - { -{ -return dev_storage + 852; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'f': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sddf6", 10) == 0) - { -{ -return dev_storage + 2083; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdcf6", 10) == 0) - { -{ -return dev_storage + 1669; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbf6", 10) == 0) - { -{ -return dev_storage + 1253; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdaf6", 10) == 0) - { -{ -return dev_storage + 837; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'e': - switch (KR_keyword [7]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sdde6", 10) == 0) - { -{ -return dev_storage + 2068; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdce6", 10) == 0) - { -{ -return dev_storage + 1654; - -} - } - else - { -{ -return NULL; - -} - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdbe6", 10) == 0) - { -{ -return dev_storage + 1238; - -} - } - else - { -{ -return NULL; - -} - } - case 'a': - if (strncmp (KR_keyword, "/dev/sdae6", 10) == 0) - { -{ -return dev_storage + 822; - -} - } - else - { -{ -return NULL; - -} - } - default: { return NULL; } } case 'd': - switch (KR_keyword [7]) + switch (KR_keyword [8]) { + case 'x': + if (strncmp (KR_keyword, "/dev/sddx6", 10) == 0) + { +{ +return dev_storage + 2481; + +} + } + else + { +{ +return NULL; + +} + } + case 'w': + if (strncmp (KR_keyword, "/dev/sddw6", 10) == 0) + { +{ +return dev_storage + 2466; + +} + } + else + { +{ +return NULL; + +} + } + case 'v': + if (strncmp (KR_keyword, "/dev/sddv6", 10) == 0) + { +{ +return dev_storage + 2451; + +} + } + else + { +{ +return NULL; + +} + } + case 'u': + if (strncmp (KR_keyword, "/dev/sddu6", 10) == 0) + { +{ +return dev_storage + 2436; + +} + } + else + { +{ +return NULL; + +} + } + case 't': + if (strncmp (KR_keyword, "/dev/sddt6", 10) == 0) + { +{ +return dev_storage + 2421; + +} + } + else + { +{ +return NULL; + +} + } + case 's': + if (strncmp (KR_keyword, "/dev/sdds6", 10) == 0) + { +{ +return dev_storage + 2406; + +} + } + else + { +{ +return NULL; + +} + } + case 'r': + if (strncmp (KR_keyword, "/dev/sddr6", 10) == 0) + { +{ +return dev_storage + 2391; + +} + } + else + { +{ +return NULL; + +} + } + case 'q': + if (strncmp (KR_keyword, "/dev/sddq6", 10) == 0) + { +{ +return dev_storage + 2376; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/sddp6", 10) == 0) + { +{ +return dev_storage + 2361; + +} + } + else + { +{ +return NULL; + +} + } + case 'o': + if (strncmp (KR_keyword, "/dev/sddo6", 10) == 0) + { +{ +return dev_storage + 2346; + +} + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/sddn6", 10) == 0) + { +{ +return dev_storage + 2331; + +} + } + else + { +{ +return NULL; + +} + } + case 'm': + if (strncmp (KR_keyword, "/dev/sddm6", 10) == 0) + { +{ +return dev_storage + 2316; + +} + } + else + { +{ +return NULL; + +} + } + case 'l': + if (strncmp (KR_keyword, "/dev/sddl6", 10) == 0) + { +{ +return dev_storage + 2301; + +} + } + else + { +{ +return NULL; + +} + } + case 'k': + if (strncmp (KR_keyword, "/dev/sddk6", 10) == 0) + { +{ +return dev_storage + 2286; + +} + } + else + { +{ +return NULL; + +} + } + case 'j': + if (strncmp (KR_keyword, "/dev/sddj6", 10) == 0) + { +{ +return dev_storage + 2271; + +} + } + else + { +{ +return NULL; + +} + } + case 'i': + if (strncmp (KR_keyword, "/dev/sddi6", 10) == 0) + { +{ +return dev_storage + 2256; + +} + } + else + { +{ +return NULL; + +} + } + case 'h': + if (strncmp (KR_keyword, "/dev/sddh6", 10) == 0) + { +{ +return dev_storage + 2241; + +} + } + else + { +{ +return NULL; + +} + } + case 'g': + if (strncmp (KR_keyword, "/dev/sddg6", 10) == 0) + { +{ +return dev_storage + 2226; + +} + } + else + { +{ +return NULL; + +} + } + case 'f': + if (strncmp (KR_keyword, "/dev/sddf6", 10) == 0) + { +{ +return dev_storage + 2211; + +} + } + else + { +{ +return NULL; + +} + } + case 'e': + if (strncmp (KR_keyword, "/dev/sdde6", 10) == 0) + { +{ +return dev_storage + 2196; + +} + } + else + { +{ +return NULL; + +} + } case 'd': if (strncmp (KR_keyword, "/dev/sddd6", 10) == 0) { { -return dev_storage + 2053; +return dev_storage + 2181; } } @@ -20569,10 +21166,10 @@ return NULL; } } case 'c': - if (strncmp (KR_keyword, "/dev/sdcd6", 10) == 0) + if (strncmp (KR_keyword, "/dev/sddc6", 10) == 0) { { -return dev_storage + 1639; +return dev_storage + 2166; } } @@ -20584,10 +21181,10 @@ return NULL; } } case 'b': - if (strncmp (KR_keyword, "/dev/sdbd6", 10) == 0) + if (strncmp (KR_keyword, "/dev/sddb6", 10) == 0) { { -return dev_storage + 1223; +return dev_storage + 2151; } } @@ -20599,10 +21196,10 @@ return NULL; } } case 'a': - if (strncmp (KR_keyword, "/dev/sdad6", 10) == 0) + if (strncmp (KR_keyword, "/dev/sdda6", 10) == 0) { { -return dev_storage + 807; +return dev_storage + 2136; } } @@ -20620,13 +21217,343 @@ return NULL; } } case 'c': - switch (KR_keyword [7]) + switch (KR_keyword [8]) { - case 'd': - if (strncmp (KR_keyword, "/dev/sddc6", 10) == 0) + case 'z': + if (strncmp (KR_keyword, "/dev/sdcz6", 10) == 0) { { -return dev_storage + 2038; +return dev_storage + 2097; + +} + } + else + { +{ +return NULL; + +} + } + case 'y': + if (strncmp (KR_keyword, "/dev/sdcy6", 10) == 0) + { +{ +return dev_storage + 2082; + +} + } + else + { +{ +return NULL; + +} + } + case 'x': + if (strncmp (KR_keyword, "/dev/sdcx6", 10) == 0) + { +{ +return dev_storage + 2067; + +} + } + else + { +{ +return NULL; + +} + } + case 'w': + if (strncmp (KR_keyword, "/dev/sdcw6", 10) == 0) + { +{ +return dev_storage + 2052; + +} + } + else + { +{ +return NULL; + +} + } + case 'v': + if (strncmp (KR_keyword, "/dev/sdcv6", 10) == 0) + { +{ +return dev_storage + 2037; + +} + } + else + { +{ +return NULL; + +} + } + case 'u': + if (strncmp (KR_keyword, "/dev/sdcu6", 10) == 0) + { +{ +return dev_storage + 2022; + +} + } + else + { +{ +return NULL; + +} + } + case 't': + if (strncmp (KR_keyword, "/dev/sdct6", 10) == 0) + { +{ +return dev_storage + 2007; + +} + } + else + { +{ +return NULL; + +} + } + case 's': + if (strncmp (KR_keyword, "/dev/sdcs6", 10) == 0) + { +{ +return dev_storage + 1992; + +} + } + else + { +{ +return NULL; + +} + } + case 'r': + if (strncmp (KR_keyword, "/dev/sdcr6", 10) == 0) + { +{ +return dev_storage + 1977; + +} + } + else + { +{ +return NULL; + +} + } + case 'q': + if (strncmp (KR_keyword, "/dev/sdcq6", 10) == 0) + { +{ +return dev_storage + 1962; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/sdcp6", 10) == 0) + { +{ +return dev_storage + 1947; + +} + } + else + { +{ +return NULL; + +} + } + case 'o': + if (strncmp (KR_keyword, "/dev/sdco6", 10) == 0) + { +{ +return dev_storage + 1932; + +} + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/sdcn6", 10) == 0) + { +{ +return dev_storage + 1917; + +} + } + else + { +{ +return NULL; + +} + } + case 'm': + if (strncmp (KR_keyword, "/dev/sdcm6", 10) == 0) + { +{ +return dev_storage + 1902; + +} + } + else + { +{ +return NULL; + +} + } + case 'l': + if (strncmp (KR_keyword, "/dev/sdcl6", 10) == 0) + { +{ +return dev_storage + 1887; + +} + } + else + { +{ +return NULL; + +} + } + case 'k': + if (strncmp (KR_keyword, "/dev/sdck6", 10) == 0) + { +{ +return dev_storage + 1872; + +} + } + else + { +{ +return NULL; + +} + } + case 'j': + if (strncmp (KR_keyword, "/dev/sdcj6", 10) == 0) + { +{ +return dev_storage + 1857; + +} + } + else + { +{ +return NULL; + +} + } + case 'i': + if (strncmp (KR_keyword, "/dev/sdci6", 10) == 0) + { +{ +return dev_storage + 1842; + +} + } + else + { +{ +return NULL; + +} + } + case 'h': + if (strncmp (KR_keyword, "/dev/sdch6", 10) == 0) + { +{ +return dev_storage + 1827; + +} + } + else + { +{ +return NULL; + +} + } + case 'g': + if (strncmp (KR_keyword, "/dev/sdcg6", 10) == 0) + { +{ +return dev_storage + 1812; + +} + } + else + { +{ +return NULL; + +} + } + case 'f': + if (strncmp (KR_keyword, "/dev/sdcf6", 10) == 0) + { +{ +return dev_storage + 1797; + +} + } + else + { +{ +return NULL; + +} + } + case 'e': + if (strncmp (KR_keyword, "/dev/sdce6", 10) == 0) + { +{ +return dev_storage + 1782; + +} + } + else + { +{ +return NULL; + +} + } + case 'd': + if (strncmp (KR_keyword, "/dev/sdcd6", 10) == 0) + { +{ +return dev_storage + 1767; } } @@ -20641,7 +21568,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc6", 10) == 0) { { -return dev_storage + 1624; +return dev_storage + 1752; } } @@ -20653,10 +21580,10 @@ return NULL; } } case 'b': - if (strncmp (KR_keyword, "/dev/sdbc6", 10) == 0) + if (strncmp (KR_keyword, "/dev/sdcb6", 10) == 0) { { -return dev_storage + 1208; +return dev_storage + 1737; } } @@ -20668,10 +21595,10 @@ return NULL; } } case 'a': - if (strncmp (KR_keyword, "/dev/sdac6", 10) == 0) + if (strncmp (KR_keyword, "/dev/sdca6", 10) == 0) { { -return dev_storage + 792; +return dev_storage + 1722; } } @@ -20689,13 +21616,343 @@ return NULL; } } case 'b': - switch (KR_keyword [7]) + switch (KR_keyword [8]) { - case 'd': - if (strncmp (KR_keyword, "/dev/sddb6", 10) == 0) + case 'z': + if (strncmp (KR_keyword, "/dev/sdbz6", 10) == 0) { { -return dev_storage + 2023; +return dev_storage + 1681; + +} + } + else + { +{ +return NULL; + +} + } + case 'y': + if (strncmp (KR_keyword, "/dev/sdby6", 10) == 0) + { +{ +return dev_storage + 1666; + +} + } + else + { +{ +return NULL; + +} + } + case 'x': + if (strncmp (KR_keyword, "/dev/sdbx6", 10) == 0) + { +{ +return dev_storage + 1651; + +} + } + else + { +{ +return NULL; + +} + } + case 'w': + if (strncmp (KR_keyword, "/dev/sdbw6", 10) == 0) + { +{ +return dev_storage + 1636; + +} + } + else + { +{ +return NULL; + +} + } + case 'v': + if (strncmp (KR_keyword, "/dev/sdbv6", 10) == 0) + { +{ +return dev_storage + 1621; + +} + } + else + { +{ +return NULL; + +} + } + case 'u': + if (strncmp (KR_keyword, "/dev/sdbu6", 10) == 0) + { +{ +return dev_storage + 1606; + +} + } + else + { +{ +return NULL; + +} + } + case 't': + if (strncmp (KR_keyword, "/dev/sdbt6", 10) == 0) + { +{ +return dev_storage + 1591; + +} + } + else + { +{ +return NULL; + +} + } + case 's': + if (strncmp (KR_keyword, "/dev/sdbs6", 10) == 0) + { +{ +return dev_storage + 1576; + +} + } + else + { +{ +return NULL; + +} + } + case 'r': + if (strncmp (KR_keyword, "/dev/sdbr6", 10) == 0) + { +{ +return dev_storage + 1561; + +} + } + else + { +{ +return NULL; + +} + } + case 'q': + if (strncmp (KR_keyword, "/dev/sdbq6", 10) == 0) + { +{ +return dev_storage + 1546; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/sdbp6", 10) == 0) + { +{ +return dev_storage + 1531; + +} + } + else + { +{ +return NULL; + +} + } + case 'o': + if (strncmp (KR_keyword, "/dev/sdbo6", 10) == 0) + { +{ +return dev_storage + 1516; + +} + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/sdbn6", 10) == 0) + { +{ +return dev_storage + 1501; + +} + } + else + { +{ +return NULL; + +} + } + case 'm': + if (strncmp (KR_keyword, "/dev/sdbm6", 10) == 0) + { +{ +return dev_storage + 1486; + +} + } + else + { +{ +return NULL; + +} + } + case 'l': + if (strncmp (KR_keyword, "/dev/sdbl6", 10) == 0) + { +{ +return dev_storage + 1471; + +} + } + else + { +{ +return NULL; + +} + } + case 'k': + if (strncmp (KR_keyword, "/dev/sdbk6", 10) == 0) + { +{ +return dev_storage + 1456; + +} + } + else + { +{ +return NULL; + +} + } + case 'j': + if (strncmp (KR_keyword, "/dev/sdbj6", 10) == 0) + { +{ +return dev_storage + 1441; + +} + } + else + { +{ +return NULL; + +} + } + case 'i': + if (strncmp (KR_keyword, "/dev/sdbi6", 10) == 0) + { +{ +return dev_storage + 1426; + +} + } + else + { +{ +return NULL; + +} + } + case 'h': + if (strncmp (KR_keyword, "/dev/sdbh6", 10) == 0) + { +{ +return dev_storage + 1411; + +} + } + else + { +{ +return NULL; + +} + } + case 'g': + if (strncmp (KR_keyword, "/dev/sdbg6", 10) == 0) + { +{ +return dev_storage + 1396; + +} + } + else + { +{ +return NULL; + +} + } + case 'f': + if (strncmp (KR_keyword, "/dev/sdbf6", 10) == 0) + { +{ +return dev_storage + 1381; + +} + } + else + { +{ +return NULL; + +} + } + case 'e': + if (strncmp (KR_keyword, "/dev/sdbe6", 10) == 0) + { +{ +return dev_storage + 1366; + +} + } + else + { +{ +return NULL; + +} + } + case 'd': + if (strncmp (KR_keyword, "/dev/sdbd6", 10) == 0) + { +{ +return dev_storage + 1351; } } @@ -20707,10 +21964,10 @@ return NULL; } } case 'c': - if (strncmp (KR_keyword, "/dev/sdcb6", 10) == 0) + if (strncmp (KR_keyword, "/dev/sdbc6", 10) == 0) { { -return dev_storage + 1609; +return dev_storage + 1336; } } @@ -20725,7 +21982,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb6", 10) == 0) { { -return dev_storage + 1193; +return dev_storage + 1321; } } @@ -20737,10 +21994,10 @@ return NULL; } } case 'a': - if (strncmp (KR_keyword, "/dev/sdab6", 10) == 0) + if (strncmp (KR_keyword, "/dev/sdba6", 10) == 0) { { -return dev_storage + 777; +return dev_storage + 1306; } } @@ -20758,13 +22015,343 @@ return NULL; } } case 'a': - switch (KR_keyword [7]) + switch (KR_keyword [8]) { - case 'd': - if (strncmp (KR_keyword, "/dev/sdda6", 10) == 0) + case 'z': + if (strncmp (KR_keyword, "/dev/sdaz6", 10) == 0) { { -return dev_storage + 2008; +return dev_storage + 1265; + +} + } + else + { +{ +return NULL; + +} + } + case 'y': + if (strncmp (KR_keyword, "/dev/sday6", 10) == 0) + { +{ +return dev_storage + 1250; + +} + } + else + { +{ +return NULL; + +} + } + case 'x': + if (strncmp (KR_keyword, "/dev/sdax6", 10) == 0) + { +{ +return dev_storage + 1235; + +} + } + else + { +{ +return NULL; + +} + } + case 'w': + if (strncmp (KR_keyword, "/dev/sdaw6", 10) == 0) + { +{ +return dev_storage + 1220; + +} + } + else + { +{ +return NULL; + +} + } + case 'v': + if (strncmp (KR_keyword, "/dev/sdav6", 10) == 0) + { +{ +return dev_storage + 1205; + +} + } + else + { +{ +return NULL; + +} + } + case 'u': + if (strncmp (KR_keyword, "/dev/sdau6", 10) == 0) + { +{ +return dev_storage + 1190; + +} + } + else + { +{ +return NULL; + +} + } + case 't': + if (strncmp (KR_keyword, "/dev/sdat6", 10) == 0) + { +{ +return dev_storage + 1175; + +} + } + else + { +{ +return NULL; + +} + } + case 's': + if (strncmp (KR_keyword, "/dev/sdas6", 10) == 0) + { +{ +return dev_storage + 1160; + +} + } + else + { +{ +return NULL; + +} + } + case 'r': + if (strncmp (KR_keyword, "/dev/sdar6", 10) == 0) + { +{ +return dev_storage + 1145; + +} + } + else + { +{ +return NULL; + +} + } + case 'q': + if (strncmp (KR_keyword, "/dev/sdaq6", 10) == 0) + { +{ +return dev_storage + 1130; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/sdap6", 10) == 0) + { +{ +return dev_storage + 1115; + +} + } + else + { +{ +return NULL; + +} + } + case 'o': + if (strncmp (KR_keyword, "/dev/sdao6", 10) == 0) + { +{ +return dev_storage + 1100; + +} + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/sdan6", 10) == 0) + { +{ +return dev_storage + 1085; + +} + } + else + { +{ +return NULL; + +} + } + case 'm': + if (strncmp (KR_keyword, "/dev/sdam6", 10) == 0) + { +{ +return dev_storage + 1070; + +} + } + else + { +{ +return NULL; + +} + } + case 'l': + if (strncmp (KR_keyword, "/dev/sdal6", 10) == 0) + { +{ +return dev_storage + 1055; + +} + } + else + { +{ +return NULL; + +} + } + case 'k': + if (strncmp (KR_keyword, "/dev/sdak6", 10) == 0) + { +{ +return dev_storage + 1040; + +} + } + else + { +{ +return NULL; + +} + } + case 'j': + if (strncmp (KR_keyword, "/dev/sdaj6", 10) == 0) + { +{ +return dev_storage + 1025; + +} + } + else + { +{ +return NULL; + +} + } + case 'i': + if (strncmp (KR_keyword, "/dev/sdai6", 10) == 0) + { +{ +return dev_storage + 1010; + +} + } + else + { +{ +return NULL; + +} + } + case 'h': + if (strncmp (KR_keyword, "/dev/sdah6", 10) == 0) + { +{ +return dev_storage + 995; + +} + } + else + { +{ +return NULL; + +} + } + case 'g': + if (strncmp (KR_keyword, "/dev/sdag6", 10) == 0) + { +{ +return dev_storage + 980; + +} + } + else + { +{ +return NULL; + +} + } + case 'f': + if (strncmp (KR_keyword, "/dev/sdaf6", 10) == 0) + { +{ +return dev_storage + 965; + +} + } + else + { +{ +return NULL; + +} + } + case 'e': + if (strncmp (KR_keyword, "/dev/sdae6", 10) == 0) + { +{ +return dev_storage + 950; + +} + } + else + { +{ +return NULL; + +} + } + case 'd': + if (strncmp (KR_keyword, "/dev/sdad6", 10) == 0) + { +{ +return dev_storage + 935; } } @@ -20776,10 +22363,10 @@ return NULL; } } case 'c': - if (strncmp (KR_keyword, "/dev/sdca6", 10) == 0) + if (strncmp (KR_keyword, "/dev/sdac6", 10) == 0) { { -return dev_storage + 1594; +return dev_storage + 920; } } @@ -20791,10 +22378,10 @@ return NULL; } } case 'b': - if (strncmp (KR_keyword, "/dev/sdba6", 10) == 0) + if (strncmp (KR_keyword, "/dev/sdab6", 10) == 0) { { -return dev_storage + 1178; +return dev_storage + 905; } } @@ -20809,253 +22396,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa6", 10) == 0) { { -return dev_storage + 762; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'S': - if (strncmp (KR_keyword, "/dev/ttyS6", 10) == 0) - { -{ -return dev_storage + 2514; - -} - } - else - { -{ -return NULL; - -} - } - case '9': - if (strncmp (KR_keyword, "/dev/nst96", 10) == 0) - { -{ -return dev_storage + 200; - -} - } - else - { -{ -return NULL; - -} - } - case '8': - if (strncmp (KR_keyword, "/dev/nst86", 10) == 0) - { -{ -return dev_storage + 190; - -} - } - else - { -{ -return NULL; - -} - } - case '7': - if (strncmp (KR_keyword, "/dev/nst76", 10) == 0) - { -{ -return dev_storage + 180; - -} - } - else - { -{ -return NULL; - -} - } - case '6': - if (strncmp (KR_keyword, "/dev/nst66", 10) == 0) - { -{ -return dev_storage + 170; - -} - } - else - { -{ -return NULL; - -} - } - case '5': - switch (KR_keyword [5]) - { - case 'p': - if (strncmp (KR_keyword, "/dev/pty56", 10) == 0) - { -{ -return dev_storage + 290; - -} - } - else - { -{ -return NULL; - -} - } - case 'n': - if (strncmp (KR_keyword, "/dev/nst56", 10) == 0) - { -{ -return dev_storage + 160; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case '4': - switch (KR_keyword [5]) - { - case 'p': - if (strncmp (KR_keyword, "/dev/pty46", 10) == 0) - { -{ -return dev_storage + 280; - -} - } - else - { -{ -return NULL; - -} - } - case 'n': - if (strncmp (KR_keyword, "/dev/nst46", 10) == 0) - { -{ -return dev_storage + 150; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case '3': - switch (KR_keyword [5]) - { - case 'p': - if (strncmp (KR_keyword, "/dev/pty36", 10) == 0) - { -{ -return dev_storage + 270; - -} - } - else - { -{ -return NULL; - -} - } - case 'n': - if (strncmp (KR_keyword, "/dev/nst36", 10) == 0) - { -{ -return dev_storage + 140; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case '2': - switch (KR_keyword [5]) - { - case 's': - if (strncmp (KR_keyword, "/dev/st126", 10) == 0) - { -{ -return dev_storage + 2505; - -} - } - else - { -{ -return NULL; - -} - } - case 'p': - if (strncmp (KR_keyword, "/dev/pty26", 10) == 0) - { -{ -return dev_storage + 260; - -} - } - else - { -{ -return NULL; - -} - } - case 'n': - if (strncmp (KR_keyword, "/dev/nst26", 10) == 0) - { -{ -return dev_storage + 130; +return dev_storage + 890; } } @@ -21073,13 +22414,28 @@ return NULL; } } case '1': - switch (KR_keyword [5]) + switch (KR_keyword [8]) { - case 's': + case '2': + if (strncmp (KR_keyword, "/dev/st126", 10) == 0) + { +{ +return dev_storage + 2633; + +} + } + else + { +{ +return NULL; + +} + } + case '1': if (strncmp (KR_keyword, "/dev/st116", 10) == 0) { { -return dev_storage + 2495; +return dev_storage + 2623; } } @@ -21090,41 +22446,11 @@ return NULL; } } - case 'p': - if (strncmp (KR_keyword, "/dev/pty16", 10) == 0) + case '0': + if (strncmp (KR_keyword, "/dev/st106", 10) == 0) { { -return dev_storage + 250; - -} - } - else - { -{ -return NULL; - -} - } - case 'n': - if (strncmp (KR_keyword, "/dev/nst16", 10) == 0) - { -{ -return dev_storage + 120; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/com16", 10) == 0) - { -{ -return dev_storage + 17; +return dev_storage + 2613; } } @@ -21139,21 +22465,6 @@ return NULL; { return NULL; -} - } - case '0': - if (strncmp (KR_keyword, "/dev/st106", 10) == 0) - { -{ -return dev_storage + 2485; - -} - } - else - { -{ -return NULL; - } } default: @@ -21169,7 +22480,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz15", 10) == 0) { { -return dev_storage + 730; +return dev_storage + 858; } } @@ -21187,7 +22498,67 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS5", 10) == 0) { { -return dev_storage + 2513; +return dev_storage + 2641; + +} + } + else + { +{ +return NULL; + +} + } + case '9': + if (strncmp (KR_keyword, "/dev/pty95", 10) == 0) + { +{ +return dev_storage + 393; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/pty85", 10) == 0) + { +{ +return dev_storage + 383; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/pty75", 10) == 0) + { +{ +return dev_storage + 373; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, "/dev/pty65", 10) == 0) + { +{ +return dev_storage + 363; } } @@ -21202,7 +22573,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty55", 10) == 0) { { -return dev_storage + 289; +return dev_storage + 353; } } @@ -21217,7 +22588,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty45", 10) == 0) { { -return dev_storage + 279; +return dev_storage + 343; } } @@ -21232,7 +22603,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty35", 10) == 0) { { -return dev_storage + 269; +return dev_storage + 333; } } @@ -21247,7 +22618,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty25", 10) == 0) { { -return dev_storage + 259; +return dev_storage + 323; } } @@ -21265,7 +22636,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy15", 10) == 0) { { -return dev_storage + 715; +return dev_storage + 843; } } @@ -21280,7 +22651,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty15", 10) == 0) { { -return dev_storage + 249; +return dev_storage + 313; } } @@ -21307,7 +22678,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx15", 10) == 0) { { -return dev_storage + 700; +return dev_storage + 828; } } @@ -21322,7 +22693,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw15", 10) == 0) { { -return dev_storage + 685; +return dev_storage + 813; } } @@ -21337,7 +22708,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv15", 10) == 0) { { -return dev_storage + 670; +return dev_storage + 798; } } @@ -21352,7 +22723,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu15", 10) == 0) { { -return dev_storage + 655; +return dev_storage + 783; } } @@ -21370,7 +22741,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst95", 10) == 0) { { -return dev_storage + 199; +return dev_storage + 263; } } @@ -21385,7 +22756,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst85", 10) == 0) { { -return dev_storage + 189; +return dev_storage + 253; } } @@ -21400,7 +22771,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst75", 10) == 0) { { -return dev_storage + 179; +return dev_storage + 243; } } @@ -21415,7 +22786,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst65", 10) == 0) { { -return dev_storage + 169; +return dev_storage + 233; } } @@ -21430,7 +22801,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst55", 10) == 0) { { -return dev_storage + 159; +return dev_storage + 223; } } @@ -21445,7 +22816,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst45", 10) == 0) { { -return dev_storage + 149; +return dev_storage + 213; } } @@ -21460,7 +22831,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst35", 10) == 0) { { -return dev_storage + 139; +return dev_storage + 203; } } @@ -21475,7 +22846,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst25", 10) == 0) { { -return dev_storage + 129; +return dev_storage + 193; } } @@ -21493,7 +22864,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt15", 10) == 0) { { -return dev_storage + 640; +return dev_storage + 768; } } @@ -21508,7 +22879,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst15", 10) == 0) { { -return dev_storage + 119; +return dev_storage + 183; } } @@ -21535,7 +22906,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds15", 10) == 0) { { -return dev_storage + 625; +return dev_storage + 753; } } @@ -21550,7 +22921,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr15", 10) == 0) { { -return dev_storage + 610; +return dev_storage + 738; } } @@ -21565,7 +22936,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq15", 10) == 0) { { -return dev_storage + 595; +return dev_storage + 723; } } @@ -21580,7 +22951,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp15", 10) == 0) { { -return dev_storage + 580; +return dev_storage + 708; } } @@ -21595,7 +22966,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo15", 10) == 0) { { -return dev_storage + 565; +return dev_storage + 693; } } @@ -21613,7 +22984,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn15", 10) == 0) { { -return dev_storage + 550; +return dev_storage + 678; } } @@ -21652,7 +23023,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm15", 10) == 0) { { -return dev_storage + 535; +return dev_storage + 663; } } @@ -21688,7 +23059,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl15", 10) == 0) { { -return dev_storage + 520; +return dev_storage + 648; } } @@ -21703,7 +23074,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk15", 10) == 0) { { -return dev_storage + 505; +return dev_storage + 633; } } @@ -21718,7 +23089,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj15", 10) == 0) { { -return dev_storage + 490; +return dev_storage + 618; } } @@ -21733,7 +23104,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi15", 10) == 0) { { -return dev_storage + 475; +return dev_storage + 603; } } @@ -21748,7 +23119,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh15", 10) == 0) { { -return dev_storage + 460; +return dev_storage + 588; } } @@ -21763,7 +23134,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg15", 10) == 0) { { -return dev_storage + 445; +return dev_storage + 573; } } @@ -21778,7 +23149,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf15", 10) == 0) { { -return dev_storage + 430; +return dev_storage + 558; } } @@ -21793,7 +23164,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde15", 10) == 0) { { -return dev_storage + 415; +return dev_storage + 543; } } @@ -21811,7 +23182,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx5", 10) == 0) { { -return dev_storage + 2352; +return dev_storage + 2480; } } @@ -21826,7 +23197,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw5", 10) == 0) { { -return dev_storage + 2337; +return dev_storage + 2465; } } @@ -21841,7 +23212,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv5", 10) == 0) { { -return dev_storage + 2322; +return dev_storage + 2450; } } @@ -21856,7 +23227,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu5", 10) == 0) { { -return dev_storage + 2307; +return dev_storage + 2435; } } @@ -21871,7 +23242,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt5", 10) == 0) { { -return dev_storage + 2292; +return dev_storage + 2420; } } @@ -21886,7 +23257,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds5", 10) == 0) { { -return dev_storage + 2277; +return dev_storage + 2405; } } @@ -21901,7 +23272,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr5", 10) == 0) { { -return dev_storage + 2262; +return dev_storage + 2390; } } @@ -21916,7 +23287,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq5", 10) == 0) { { -return dev_storage + 2247; +return dev_storage + 2375; } } @@ -21931,7 +23302,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp5", 10) == 0) { { -return dev_storage + 2232; +return dev_storage + 2360; } } @@ -21946,7 +23317,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo5", 10) == 0) { { -return dev_storage + 2217; +return dev_storage + 2345; } } @@ -21961,7 +23332,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn5", 10) == 0) { { -return dev_storage + 2202; +return dev_storage + 2330; } } @@ -21976,7 +23347,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm5", 10) == 0) { { -return dev_storage + 2187; +return dev_storage + 2315; } } @@ -21991,7 +23362,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl5", 10) == 0) { { -return dev_storage + 2172; +return dev_storage + 2300; } } @@ -22006,7 +23377,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk5", 10) == 0) { { -return dev_storage + 2157; +return dev_storage + 2285; } } @@ -22021,7 +23392,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj5", 10) == 0) { { -return dev_storage + 2142; +return dev_storage + 2270; } } @@ -22036,7 +23407,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi5", 10) == 0) { { -return dev_storage + 2127; +return dev_storage + 2255; } } @@ -22051,7 +23422,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh5", 10) == 0) { { -return dev_storage + 2112; +return dev_storage + 2240; } } @@ -22066,7 +23437,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg5", 10) == 0) { { -return dev_storage + 2097; +return dev_storage + 2225; } } @@ -22081,7 +23452,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf5", 10) == 0) { { -return dev_storage + 2082; +return dev_storage + 2210; } } @@ -22096,7 +23467,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde5", 10) == 0) { { -return dev_storage + 2067; +return dev_storage + 2195; } } @@ -22111,7 +23482,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd5", 10) == 0) { { -return dev_storage + 2052; +return dev_storage + 2180; } } @@ -22126,7 +23497,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc5", 10) == 0) { { -return dev_storage + 2037; +return dev_storage + 2165; } } @@ -22141,7 +23512,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb5", 10) == 0) { { -return dev_storage + 2022; +return dev_storage + 2150; } } @@ -22156,7 +23527,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda5", 10) == 0) { { -return dev_storage + 2007; +return dev_storage + 2135; } } @@ -22174,7 +23545,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd15", 10) == 0) { { -return dev_storage + 400; +return dev_storage + 528; } } @@ -22189,7 +23560,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd15", 10) == 0) { { -return dev_storage + 314; +return dev_storage + 442; } } @@ -22219,7 +23590,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz5", 10) == 0) { { -return dev_storage + 1968; +return dev_storage + 2096; } } @@ -22234,7 +23605,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy5", 10) == 0) { { -return dev_storage + 1953; +return dev_storage + 2081; } } @@ -22249,7 +23620,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx5", 10) == 0) { { -return dev_storage + 1938; +return dev_storage + 2066; } } @@ -22264,7 +23635,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw5", 10) == 0) { { -return dev_storage + 1923; +return dev_storage + 2051; } } @@ -22279,7 +23650,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv5", 10) == 0) { { -return dev_storage + 1908; +return dev_storage + 2036; } } @@ -22294,7 +23665,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu5", 10) == 0) { { -return dev_storage + 1893; +return dev_storage + 2021; } } @@ -22309,7 +23680,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct5", 10) == 0) { { -return dev_storage + 1878; +return dev_storage + 2006; } } @@ -22324,7 +23695,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs5", 10) == 0) { { -return dev_storage + 1863; +return dev_storage + 1991; } } @@ -22339,7 +23710,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr5", 10) == 0) { { -return dev_storage + 1848; +return dev_storage + 1976; } } @@ -22354,7 +23725,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq5", 10) == 0) { { -return dev_storage + 1833; +return dev_storage + 1961; } } @@ -22369,7 +23740,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp5", 10) == 0) { { -return dev_storage + 1818; +return dev_storage + 1946; } } @@ -22384,7 +23755,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco5", 10) == 0) { { -return dev_storage + 1803; +return dev_storage + 1931; } } @@ -22399,7 +23770,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn5", 10) == 0) { { -return dev_storage + 1788; +return dev_storage + 1916; } } @@ -22414,7 +23785,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm5", 10) == 0) { { -return dev_storage + 1773; +return dev_storage + 1901; } } @@ -22429,7 +23800,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl5", 10) == 0) { { -return dev_storage + 1758; +return dev_storage + 1886; } } @@ -22444,7 +23815,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck5", 10) == 0) { { -return dev_storage + 1743; +return dev_storage + 1871; } } @@ -22459,7 +23830,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj5", 10) == 0) { { -return dev_storage + 1728; +return dev_storage + 1856; } } @@ -22474,7 +23845,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci5", 10) == 0) { { -return dev_storage + 1713; +return dev_storage + 1841; } } @@ -22489,7 +23860,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch5", 10) == 0) { { -return dev_storage + 1698; +return dev_storage + 1826; } } @@ -22504,7 +23875,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg5", 10) == 0) { { -return dev_storage + 1683; +return dev_storage + 1811; } } @@ -22519,7 +23890,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf5", 10) == 0) { { -return dev_storage + 1668; +return dev_storage + 1796; } } @@ -22534,7 +23905,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce5", 10) == 0) { { -return dev_storage + 1653; +return dev_storage + 1781; } } @@ -22549,7 +23920,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd5", 10) == 0) { { -return dev_storage + 1638; +return dev_storage + 1766; } } @@ -22564,7 +23935,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc5", 10) == 0) { { -return dev_storage + 1623; +return dev_storage + 1751; } } @@ -22579,7 +23950,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb5", 10) == 0) { { -return dev_storage + 1608; +return dev_storage + 1736; } } @@ -22594,7 +23965,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca5", 10) == 0) { { -return dev_storage + 1593; +return dev_storage + 1721; } } @@ -22609,7 +23980,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc15", 10) == 0) { { -return dev_storage + 385; +return dev_storage + 513; } } @@ -22633,7 +24004,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz5", 10) == 0) { { -return dev_storage + 1552; +return dev_storage + 1680; } } @@ -22648,7 +24019,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby5", 10) == 0) { { -return dev_storage + 1537; +return dev_storage + 1665; } } @@ -22663,7 +24034,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx5", 10) == 0) { { -return dev_storage + 1522; +return dev_storage + 1650; } } @@ -22678,7 +24049,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw5", 10) == 0) { { -return dev_storage + 1507; +return dev_storage + 1635; } } @@ -22693,7 +24064,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv5", 10) == 0) { { -return dev_storage + 1492; +return dev_storage + 1620; } } @@ -22708,7 +24079,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu5", 10) == 0) { { -return dev_storage + 1477; +return dev_storage + 1605; } } @@ -22723,7 +24094,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt5", 10) == 0) { { -return dev_storage + 1462; +return dev_storage + 1590; } } @@ -22738,7 +24109,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs5", 10) == 0) { { -return dev_storage + 1447; +return dev_storage + 1575; } } @@ -22753,7 +24124,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr5", 10) == 0) { { -return dev_storage + 1432; +return dev_storage + 1560; } } @@ -22768,7 +24139,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq5", 10) == 0) { { -return dev_storage + 1417; +return dev_storage + 1545; } } @@ -22783,7 +24154,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp5", 10) == 0) { { -return dev_storage + 1402; +return dev_storage + 1530; } } @@ -22798,7 +24169,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo5", 10) == 0) { { -return dev_storage + 1387; +return dev_storage + 1515; } } @@ -22813,7 +24184,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn5", 10) == 0) { { -return dev_storage + 1372; +return dev_storage + 1500; } } @@ -22828,7 +24199,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm5", 10) == 0) { { -return dev_storage + 1357; +return dev_storage + 1485; } } @@ -22843,7 +24214,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl5", 10) == 0) { { -return dev_storage + 1342; +return dev_storage + 1470; } } @@ -22858,7 +24229,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk5", 10) == 0) { { -return dev_storage + 1327; +return dev_storage + 1455; } } @@ -22873,7 +24244,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj5", 10) == 0) { { -return dev_storage + 1312; +return dev_storage + 1440; } } @@ -22888,7 +24259,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi5", 10) == 0) { { -return dev_storage + 1297; +return dev_storage + 1425; } } @@ -22903,7 +24274,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh5", 10) == 0) { { -return dev_storage + 1282; +return dev_storage + 1410; } } @@ -22918,7 +24289,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg5", 10) == 0) { { -return dev_storage + 1267; +return dev_storage + 1395; } } @@ -22933,7 +24304,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf5", 10) == 0) { { -return dev_storage + 1252; +return dev_storage + 1380; } } @@ -22948,7 +24319,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe5", 10) == 0) { { -return dev_storage + 1237; +return dev_storage + 1365; } } @@ -22963,7 +24334,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd5", 10) == 0) { { -return dev_storage + 1222; +return dev_storage + 1350; } } @@ -22978,7 +24349,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc5", 10) == 0) { { -return dev_storage + 1207; +return dev_storage + 1335; } } @@ -22993,7 +24364,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb5", 10) == 0) { { -return dev_storage + 1192; +return dev_storage + 1320; } } @@ -23008,7 +24379,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba5", 10) == 0) { { -return dev_storage + 1177; +return dev_storage + 1305; } } @@ -23023,7 +24394,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb15", 10) == 0) { { -return dev_storage + 370; +return dev_storage + 498; } } @@ -23047,7 +24418,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz5", 10) == 0) { { -return dev_storage + 1136; +return dev_storage + 1264; } } @@ -23062,7 +24433,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday5", 10) == 0) { { -return dev_storage + 1121; +return dev_storage + 1249; } } @@ -23077,7 +24448,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax5", 10) == 0) { { -return dev_storage + 1106; +return dev_storage + 1234; } } @@ -23092,7 +24463,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw5", 10) == 0) { { -return dev_storage + 1091; +return dev_storage + 1219; } } @@ -23107,7 +24478,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav5", 10) == 0) { { -return dev_storage + 1076; +return dev_storage + 1204; } } @@ -23122,7 +24493,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau5", 10) == 0) { { -return dev_storage + 1061; +return dev_storage + 1189; } } @@ -23137,7 +24508,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat5", 10) == 0) { { -return dev_storage + 1046; +return dev_storage + 1174; } } @@ -23152,7 +24523,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas5", 10) == 0) { { -return dev_storage + 1031; +return dev_storage + 1159; } } @@ -23167,7 +24538,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar5", 10) == 0) { { -return dev_storage + 1016; +return dev_storage + 1144; } } @@ -23182,7 +24553,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq5", 10) == 0) { { -return dev_storage + 1001; +return dev_storage + 1129; } } @@ -23197,7 +24568,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap5", 10) == 0) { { -return dev_storage + 986; +return dev_storage + 1114; } } @@ -23212,7 +24583,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao5", 10) == 0) { { -return dev_storage + 971; +return dev_storage + 1099; } } @@ -23227,7 +24598,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan5", 10) == 0) { { -return dev_storage + 956; +return dev_storage + 1084; } } @@ -23242,7 +24613,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam5", 10) == 0) { { -return dev_storage + 941; +return dev_storage + 1069; } } @@ -23257,7 +24628,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal5", 10) == 0) { { -return dev_storage + 926; +return dev_storage + 1054; } } @@ -23272,7 +24643,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak5", 10) == 0) { { -return dev_storage + 911; +return dev_storage + 1039; } } @@ -23287,7 +24658,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj5", 10) == 0) { { -return dev_storage + 896; +return dev_storage + 1024; } } @@ -23302,7 +24673,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai5", 10) == 0) { { -return dev_storage + 881; +return dev_storage + 1009; } } @@ -23317,7 +24688,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah5", 10) == 0) { { -return dev_storage + 866; +return dev_storage + 994; } } @@ -23332,7 +24703,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag5", 10) == 0) { { -return dev_storage + 851; +return dev_storage + 979; } } @@ -23347,7 +24718,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf5", 10) == 0) { { -return dev_storage + 836; +return dev_storage + 964; } } @@ -23362,7 +24733,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae5", 10) == 0) { { -return dev_storage + 821; +return dev_storage + 949; } } @@ -23377,7 +24748,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad5", 10) == 0) { { -return dev_storage + 806; +return dev_storage + 934; } } @@ -23392,7 +24763,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac5", 10) == 0) { { -return dev_storage + 791; +return dev_storage + 919; } } @@ -23407,7 +24778,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab5", 10) == 0) { { -return dev_storage + 776; +return dev_storage + 904; } } @@ -23422,7 +24793,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa5", 10) == 0) { { -return dev_storage + 761; +return dev_storage + 889; } } @@ -23437,7 +24808,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda15", 10) == 0) { { -return dev_storage + 355; +return dev_storage + 483; } } @@ -23461,7 +24832,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st125", 10) == 0) { { -return dev_storage + 2504; +return dev_storage + 2632; } } @@ -23476,7 +24847,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st115", 10) == 0) { { -return dev_storage + 2494; +return dev_storage + 2622; } } @@ -23491,7 +24862,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st105", 10) == 0) { { -return dev_storage + 2484; +return dev_storage + 2612; } } @@ -23521,7 +24892,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz14", 10) == 0) { { -return dev_storage + 729; +return dev_storage + 857; } } @@ -23539,7 +24910,67 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS4", 10) == 0) { { -return dev_storage + 2512; +return dev_storage + 2640; + +} + } + else + { +{ +return NULL; + +} + } + case '9': + if (strncmp (KR_keyword, "/dev/pty94", 10) == 0) + { +{ +return dev_storage + 392; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/pty84", 10) == 0) + { +{ +return dev_storage + 382; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/pty74", 10) == 0) + { +{ +return dev_storage + 372; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, "/dev/pty64", 10) == 0) + { +{ +return dev_storage + 362; } } @@ -23554,7 +24985,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty54", 10) == 0) { { -return dev_storage + 288; +return dev_storage + 352; } } @@ -23569,7 +25000,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty44", 10) == 0) { { -return dev_storage + 278; +return dev_storage + 342; } } @@ -23584,7 +25015,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty34", 10) == 0) { { -return dev_storage + 268; +return dev_storage + 332; } } @@ -23599,7 +25030,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty24", 10) == 0) { { -return dev_storage + 258; +return dev_storage + 322; } } @@ -23617,7 +25048,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy14", 10) == 0) { { -return dev_storage + 714; +return dev_storage + 842; } } @@ -23632,7 +25063,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty14", 10) == 0) { { -return dev_storage + 248; +return dev_storage + 312; } } @@ -23659,7 +25090,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx14", 10) == 0) { { -return dev_storage + 699; +return dev_storage + 827; } } @@ -23674,7 +25105,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw14", 10) == 0) { { -return dev_storage + 684; +return dev_storage + 812; } } @@ -23689,7 +25120,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv14", 10) == 0) { { -return dev_storage + 669; +return dev_storage + 797; } } @@ -23704,7 +25135,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu14", 10) == 0) { { -return dev_storage + 654; +return dev_storage + 782; } } @@ -23722,7 +25153,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst94", 10) == 0) { { -return dev_storage + 198; +return dev_storage + 262; } } @@ -23737,7 +25168,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst84", 10) == 0) { { -return dev_storage + 188; +return dev_storage + 252; } } @@ -23752,7 +25183,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst74", 10) == 0) { { -return dev_storage + 178; +return dev_storage + 242; } } @@ -23767,7 +25198,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst64", 10) == 0) { { -return dev_storage + 168; +return dev_storage + 232; } } @@ -23782,7 +25213,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst54", 10) == 0) { { -return dev_storage + 158; +return dev_storage + 222; } } @@ -23797,7 +25228,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst44", 10) == 0) { { -return dev_storage + 148; +return dev_storage + 212; } } @@ -23812,7 +25243,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst34", 10) == 0) { { -return dev_storage + 138; +return dev_storage + 202; } } @@ -23827,7 +25258,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst24", 10) == 0) { { -return dev_storage + 128; +return dev_storage + 192; } } @@ -23845,7 +25276,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt14", 10) == 0) { { -return dev_storage + 639; +return dev_storage + 767; } } @@ -23860,7 +25291,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst14", 10) == 0) { { -return dev_storage + 118; +return dev_storage + 182; } } @@ -23887,7 +25318,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds14", 10) == 0) { { -return dev_storage + 624; +return dev_storage + 752; } } @@ -23902,7 +25333,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr14", 10) == 0) { { -return dev_storage + 609; +return dev_storage + 737; } } @@ -23917,7 +25348,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq14", 10) == 0) { { -return dev_storage + 594; +return dev_storage + 722; } } @@ -23932,7 +25363,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp14", 10) == 0) { { -return dev_storage + 579; +return dev_storage + 707; } } @@ -23947,7 +25378,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo14", 10) == 0) { { -return dev_storage + 564; +return dev_storage + 692; } } @@ -23965,7 +25396,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn14", 10) == 0) { { -return dev_storage + 549; +return dev_storage + 677; } } @@ -24004,7 +25435,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm14", 10) == 0) { { -return dev_storage + 534; +return dev_storage + 662; } } @@ -24040,7 +25471,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl14", 10) == 0) { { -return dev_storage + 519; +return dev_storage + 647; } } @@ -24055,7 +25486,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk14", 10) == 0) { { -return dev_storage + 504; +return dev_storage + 632; } } @@ -24070,7 +25501,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj14", 10) == 0) { { -return dev_storage + 489; +return dev_storage + 617; } } @@ -24085,7 +25516,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi14", 10) == 0) { { -return dev_storage + 474; +return dev_storage + 602; } } @@ -24100,7 +25531,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh14", 10) == 0) { { -return dev_storage + 459; +return dev_storage + 587; } } @@ -24115,7 +25546,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg14", 10) == 0) { { -return dev_storage + 444; +return dev_storage + 572; } } @@ -24130,7 +25561,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf14", 10) == 0) { { -return dev_storage + 429; +return dev_storage + 557; } } @@ -24145,7 +25576,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde14", 10) == 0) { { -return dev_storage + 414; +return dev_storage + 542; } } @@ -24163,7 +25594,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx4", 10) == 0) { { -return dev_storage + 2351; +return dev_storage + 2479; } } @@ -24178,7 +25609,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw4", 10) == 0) { { -return dev_storage + 2336; +return dev_storage + 2464; } } @@ -24193,7 +25624,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv4", 10) == 0) { { -return dev_storage + 2321; +return dev_storage + 2449; } } @@ -24208,7 +25639,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu4", 10) == 0) { { -return dev_storage + 2306; +return dev_storage + 2434; } } @@ -24223,7 +25654,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt4", 10) == 0) { { -return dev_storage + 2291; +return dev_storage + 2419; } } @@ -24238,7 +25669,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds4", 10) == 0) { { -return dev_storage + 2276; +return dev_storage + 2404; } } @@ -24253,7 +25684,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr4", 10) == 0) { { -return dev_storage + 2261; +return dev_storage + 2389; } } @@ -24268,7 +25699,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq4", 10) == 0) { { -return dev_storage + 2246; +return dev_storage + 2374; } } @@ -24283,7 +25714,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp4", 10) == 0) { { -return dev_storage + 2231; +return dev_storage + 2359; } } @@ -24298,7 +25729,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo4", 10) == 0) { { -return dev_storage + 2216; +return dev_storage + 2344; } } @@ -24313,7 +25744,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn4", 10) == 0) { { -return dev_storage + 2201; +return dev_storage + 2329; } } @@ -24328,7 +25759,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm4", 10) == 0) { { -return dev_storage + 2186; +return dev_storage + 2314; } } @@ -24343,7 +25774,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl4", 10) == 0) { { -return dev_storage + 2171; +return dev_storage + 2299; } } @@ -24358,7 +25789,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk4", 10) == 0) { { -return dev_storage + 2156; +return dev_storage + 2284; } } @@ -24373,7 +25804,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj4", 10) == 0) { { -return dev_storage + 2141; +return dev_storage + 2269; } } @@ -24388,7 +25819,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi4", 10) == 0) { { -return dev_storage + 2126; +return dev_storage + 2254; } } @@ -24403,7 +25834,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh4", 10) == 0) { { -return dev_storage + 2111; +return dev_storage + 2239; } } @@ -24418,7 +25849,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg4", 10) == 0) { { -return dev_storage + 2096; +return dev_storage + 2224; } } @@ -24433,7 +25864,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf4", 10) == 0) { { -return dev_storage + 2081; +return dev_storage + 2209; } } @@ -24448,7 +25879,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde4", 10) == 0) { { -return dev_storage + 2066; +return dev_storage + 2194; } } @@ -24463,7 +25894,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd4", 10) == 0) { { -return dev_storage + 2051; +return dev_storage + 2179; } } @@ -24478,7 +25909,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc4", 10) == 0) { { -return dev_storage + 2036; +return dev_storage + 2164; } } @@ -24493,7 +25924,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb4", 10) == 0) { { -return dev_storage + 2021; +return dev_storage + 2149; } } @@ -24508,7 +25939,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda4", 10) == 0) { { -return dev_storage + 2006; +return dev_storage + 2134; } } @@ -24526,7 +25957,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd14", 10) == 0) { { -return dev_storage + 399; +return dev_storage + 527; } } @@ -24541,7 +25972,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd14", 10) == 0) { { -return dev_storage + 313; +return dev_storage + 441; } } @@ -24571,7 +26002,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz4", 10) == 0) { { -return dev_storage + 1967; +return dev_storage + 2095; } } @@ -24586,7 +26017,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy4", 10) == 0) { { -return dev_storage + 1952; +return dev_storage + 2080; } } @@ -24601,7 +26032,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx4", 10) == 0) { { -return dev_storage + 1937; +return dev_storage + 2065; } } @@ -24616,7 +26047,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw4", 10) == 0) { { -return dev_storage + 1922; +return dev_storage + 2050; } } @@ -24631,7 +26062,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv4", 10) == 0) { { -return dev_storage + 1907; +return dev_storage + 2035; } } @@ -24646,7 +26077,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu4", 10) == 0) { { -return dev_storage + 1892; +return dev_storage + 2020; } } @@ -24661,7 +26092,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct4", 10) == 0) { { -return dev_storage + 1877; +return dev_storage + 2005; } } @@ -24676,7 +26107,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs4", 10) == 0) { { -return dev_storage + 1862; +return dev_storage + 1990; } } @@ -24691,7 +26122,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr4", 10) == 0) { { -return dev_storage + 1847; +return dev_storage + 1975; } } @@ -24706,7 +26137,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq4", 10) == 0) { { -return dev_storage + 1832; +return dev_storage + 1960; } } @@ -24721,7 +26152,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp4", 10) == 0) { { -return dev_storage + 1817; +return dev_storage + 1945; } } @@ -24736,7 +26167,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco4", 10) == 0) { { -return dev_storage + 1802; +return dev_storage + 1930; } } @@ -24751,7 +26182,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn4", 10) == 0) { { -return dev_storage + 1787; +return dev_storage + 1915; } } @@ -24766,7 +26197,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm4", 10) == 0) { { -return dev_storage + 1772; +return dev_storage + 1900; } } @@ -24781,7 +26212,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl4", 10) == 0) { { -return dev_storage + 1757; +return dev_storage + 1885; } } @@ -24796,7 +26227,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck4", 10) == 0) { { -return dev_storage + 1742; +return dev_storage + 1870; } } @@ -24811,7 +26242,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj4", 10) == 0) { { -return dev_storage + 1727; +return dev_storage + 1855; } } @@ -24826,7 +26257,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci4", 10) == 0) { { -return dev_storage + 1712; +return dev_storage + 1840; } } @@ -24841,7 +26272,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch4", 10) == 0) { { -return dev_storage + 1697; +return dev_storage + 1825; } } @@ -24856,7 +26287,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg4", 10) == 0) { { -return dev_storage + 1682; +return dev_storage + 1810; } } @@ -24871,7 +26302,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf4", 10) == 0) { { -return dev_storage + 1667; +return dev_storage + 1795; } } @@ -24886,7 +26317,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce4", 10) == 0) { { -return dev_storage + 1652; +return dev_storage + 1780; } } @@ -24901,7 +26332,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd4", 10) == 0) { { -return dev_storage + 1637; +return dev_storage + 1765; } } @@ -24916,7 +26347,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc4", 10) == 0) { { -return dev_storage + 1622; +return dev_storage + 1750; } } @@ -24931,7 +26362,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb4", 10) == 0) { { -return dev_storage + 1607; +return dev_storage + 1735; } } @@ -24946,7 +26377,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca4", 10) == 0) { { -return dev_storage + 1592; +return dev_storage + 1720; } } @@ -24961,7 +26392,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc14", 10) == 0) { { -return dev_storage + 384; +return dev_storage + 512; } } @@ -24985,7 +26416,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz4", 10) == 0) { { -return dev_storage + 1551; +return dev_storage + 1679; } } @@ -25000,7 +26431,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby4", 10) == 0) { { -return dev_storage + 1536; +return dev_storage + 1664; } } @@ -25015,7 +26446,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx4", 10) == 0) { { -return dev_storage + 1521; +return dev_storage + 1649; } } @@ -25030,7 +26461,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw4", 10) == 0) { { -return dev_storage + 1506; +return dev_storage + 1634; } } @@ -25045,7 +26476,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv4", 10) == 0) { { -return dev_storage + 1491; +return dev_storage + 1619; } } @@ -25060,7 +26491,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu4", 10) == 0) { { -return dev_storage + 1476; +return dev_storage + 1604; } } @@ -25075,7 +26506,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt4", 10) == 0) { { -return dev_storage + 1461; +return dev_storage + 1589; } } @@ -25090,7 +26521,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs4", 10) == 0) { { -return dev_storage + 1446; +return dev_storage + 1574; } } @@ -25105,7 +26536,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr4", 10) == 0) { { -return dev_storage + 1431; +return dev_storage + 1559; } } @@ -25120,7 +26551,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq4", 10) == 0) { { -return dev_storage + 1416; +return dev_storage + 1544; } } @@ -25135,7 +26566,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp4", 10) == 0) { { -return dev_storage + 1401; +return dev_storage + 1529; } } @@ -25150,7 +26581,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo4", 10) == 0) { { -return dev_storage + 1386; +return dev_storage + 1514; } } @@ -25165,7 +26596,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn4", 10) == 0) { { -return dev_storage + 1371; +return dev_storage + 1499; } } @@ -25180,7 +26611,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm4", 10) == 0) { { -return dev_storage + 1356; +return dev_storage + 1484; } } @@ -25195,7 +26626,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl4", 10) == 0) { { -return dev_storage + 1341; +return dev_storage + 1469; } } @@ -25210,7 +26641,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk4", 10) == 0) { { -return dev_storage + 1326; +return dev_storage + 1454; } } @@ -25225,7 +26656,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj4", 10) == 0) { { -return dev_storage + 1311; +return dev_storage + 1439; } } @@ -25240,7 +26671,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi4", 10) == 0) { { -return dev_storage + 1296; +return dev_storage + 1424; } } @@ -25255,7 +26686,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh4", 10) == 0) { { -return dev_storage + 1281; +return dev_storage + 1409; } } @@ -25270,7 +26701,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg4", 10) == 0) { { -return dev_storage + 1266; +return dev_storage + 1394; } } @@ -25285,7 +26716,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf4", 10) == 0) { { -return dev_storage + 1251; +return dev_storage + 1379; } } @@ -25300,7 +26731,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe4", 10) == 0) { { -return dev_storage + 1236; +return dev_storage + 1364; } } @@ -25315,7 +26746,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd4", 10) == 0) { { -return dev_storage + 1221; +return dev_storage + 1349; } } @@ -25330,7 +26761,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc4", 10) == 0) { { -return dev_storage + 1206; +return dev_storage + 1334; } } @@ -25345,7 +26776,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb4", 10) == 0) { { -return dev_storage + 1191; +return dev_storage + 1319; } } @@ -25360,7 +26791,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba4", 10) == 0) { { -return dev_storage + 1176; +return dev_storage + 1304; } } @@ -25375,7 +26806,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb14", 10) == 0) { { -return dev_storage + 369; +return dev_storage + 497; } } @@ -25399,7 +26830,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz4", 10) == 0) { { -return dev_storage + 1135; +return dev_storage + 1263; } } @@ -25414,7 +26845,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday4", 10) == 0) { { -return dev_storage + 1120; +return dev_storage + 1248; } } @@ -25429,7 +26860,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax4", 10) == 0) { { -return dev_storage + 1105; +return dev_storage + 1233; } } @@ -25444,7 +26875,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw4", 10) == 0) { { -return dev_storage + 1090; +return dev_storage + 1218; } } @@ -25459,7 +26890,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav4", 10) == 0) { { -return dev_storage + 1075; +return dev_storage + 1203; } } @@ -25474,7 +26905,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau4", 10) == 0) { { -return dev_storage + 1060; +return dev_storage + 1188; } } @@ -25489,7 +26920,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat4", 10) == 0) { { -return dev_storage + 1045; +return dev_storage + 1173; } } @@ -25504,7 +26935,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas4", 10) == 0) { { -return dev_storage + 1030; +return dev_storage + 1158; } } @@ -25519,7 +26950,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar4", 10) == 0) { { -return dev_storage + 1015; +return dev_storage + 1143; } } @@ -25534,7 +26965,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq4", 10) == 0) { { -return dev_storage + 1000; +return dev_storage + 1128; } } @@ -25549,7 +26980,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap4", 10) == 0) { { -return dev_storage + 985; +return dev_storage + 1113; } } @@ -25564,7 +26995,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao4", 10) == 0) { { -return dev_storage + 970; +return dev_storage + 1098; } } @@ -25579,7 +27010,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan4", 10) == 0) { { -return dev_storage + 955; +return dev_storage + 1083; } } @@ -25594,7 +27025,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam4", 10) == 0) { { -return dev_storage + 940; +return dev_storage + 1068; } } @@ -25609,7 +27040,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal4", 10) == 0) { { -return dev_storage + 925; +return dev_storage + 1053; } } @@ -25624,7 +27055,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak4", 10) == 0) { { -return dev_storage + 910; +return dev_storage + 1038; } } @@ -25639,7 +27070,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj4", 10) == 0) { { -return dev_storage + 895; +return dev_storage + 1023; } } @@ -25654,7 +27085,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai4", 10) == 0) { { -return dev_storage + 880; +return dev_storage + 1008; } } @@ -25669,7 +27100,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah4", 10) == 0) { { -return dev_storage + 865; +return dev_storage + 993; } } @@ -25684,7 +27115,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag4", 10) == 0) { { -return dev_storage + 850; +return dev_storage + 978; } } @@ -25699,7 +27130,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf4", 10) == 0) { { -return dev_storage + 835; +return dev_storage + 963; } } @@ -25714,7 +27145,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae4", 10) == 0) { { -return dev_storage + 820; +return dev_storage + 948; } } @@ -25729,7 +27160,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad4", 10) == 0) { { -return dev_storage + 805; +return dev_storage + 933; } } @@ -25744,7 +27175,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac4", 10) == 0) { { -return dev_storage + 790; +return dev_storage + 918; } } @@ -25759,7 +27190,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab4", 10) == 0) { { -return dev_storage + 775; +return dev_storage + 903; } } @@ -25774,7 +27205,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa4", 10) == 0) { { -return dev_storage + 760; +return dev_storage + 888; } } @@ -25789,7 +27220,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda14", 10) == 0) { { -return dev_storage + 354; +return dev_storage + 482; } } @@ -25813,7 +27244,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st124", 10) == 0) { { -return dev_storage + 2503; +return dev_storage + 2631; } } @@ -25828,7 +27259,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st114", 10) == 0) { { -return dev_storage + 2493; +return dev_storage + 2621; } } @@ -25843,7 +27274,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st104", 10) == 0) { { -return dev_storage + 2483; +return dev_storage + 2611; } } @@ -25873,7 +27304,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz13", 10) == 0) { { -return dev_storage + 728; +return dev_storage + 856; } } @@ -25891,7 +27322,52 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS3", 10) == 0) { { -return dev_storage + 2511; +return dev_storage + 2639; + +} + } + else + { +{ +return NULL; + +} + } + case '9': + if (strncmp (KR_keyword, "/dev/pty93", 10) == 0) + { +{ +return dev_storage + 391; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/pty83", 10) == 0) + { +{ +return dev_storage + 381; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/pty73", 10) == 0) + { +{ +return dev_storage + 371; } } @@ -25906,7 +27382,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty63", 10) == 0) { { -return dev_storage + 297; +return dev_storage + 361; } } @@ -25921,7 +27397,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty53", 10) == 0) { { -return dev_storage + 287; +return dev_storage + 351; } } @@ -25936,7 +27412,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty43", 10) == 0) { { -return dev_storage + 277; +return dev_storage + 341; } } @@ -25951,7 +27427,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty33", 10) == 0) { { -return dev_storage + 267; +return dev_storage + 331; } } @@ -25966,7 +27442,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty23", 10) == 0) { { -return dev_storage + 257; +return dev_storage + 321; } } @@ -25984,7 +27460,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy13", 10) == 0) { { -return dev_storage + 713; +return dev_storage + 841; } } @@ -25999,7 +27475,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty13", 10) == 0) { { -return dev_storage + 247; +return dev_storage + 311; } } @@ -26026,7 +27502,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx13", 10) == 0) { { -return dev_storage + 698; +return dev_storage + 826; } } @@ -26041,7 +27517,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw13", 10) == 0) { { -return dev_storage + 683; +return dev_storage + 811; } } @@ -26056,7 +27532,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv13", 10) == 0) { { -return dev_storage + 668; +return dev_storage + 796; } } @@ -26071,7 +27547,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu13", 10) == 0) { { -return dev_storage + 653; +return dev_storage + 781; } } @@ -26089,7 +27565,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst93", 10) == 0) { { -return dev_storage + 197; +return dev_storage + 261; } } @@ -26104,7 +27580,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst83", 10) == 0) { { -return dev_storage + 187; +return dev_storage + 251; } } @@ -26119,7 +27595,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst73", 10) == 0) { { -return dev_storage + 177; +return dev_storage + 241; } } @@ -26134,7 +27610,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst63", 10) == 0) { { -return dev_storage + 167; +return dev_storage + 231; } } @@ -26149,7 +27625,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst53", 10) == 0) { { -return dev_storage + 157; +return dev_storage + 221; } } @@ -26164,7 +27640,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst43", 10) == 0) { { -return dev_storage + 147; +return dev_storage + 211; } } @@ -26179,7 +27655,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst33", 10) == 0) { { -return dev_storage + 137; +return dev_storage + 201; } } @@ -26194,7 +27670,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst23", 10) == 0) { { -return dev_storage + 127; +return dev_storage + 191; } } @@ -26212,7 +27688,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt13", 10) == 0) { { -return dev_storage + 638; +return dev_storage + 766; } } @@ -26227,7 +27703,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst13", 10) == 0) { { -return dev_storage + 117; +return dev_storage + 181; } } @@ -26254,7 +27730,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds13", 10) == 0) { { -return dev_storage + 623; +return dev_storage + 751; } } @@ -26269,7 +27745,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr13", 10) == 0) { { -return dev_storage + 608; +return dev_storage + 736; } } @@ -26284,7 +27760,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq13", 10) == 0) { { -return dev_storage + 593; +return dev_storage + 721; } } @@ -26299,7 +27775,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp13", 10) == 0) { { -return dev_storage + 578; +return dev_storage + 706; } } @@ -26314,7 +27790,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo13", 10) == 0) { { -return dev_storage + 563; +return dev_storage + 691; } } @@ -26332,7 +27808,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn13", 10) == 0) { { -return dev_storage + 548; +return dev_storage + 676; } } @@ -26371,7 +27847,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm13", 10) == 0) { { -return dev_storage + 533; +return dev_storage + 661; } } @@ -26407,7 +27883,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl13", 10) == 0) { { -return dev_storage + 518; +return dev_storage + 646; } } @@ -26422,7 +27898,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk13", 10) == 0) { { -return dev_storage + 503; +return dev_storage + 631; } } @@ -26437,7 +27913,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj13", 10) == 0) { { -return dev_storage + 488; +return dev_storage + 616; } } @@ -26452,7 +27928,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi13", 10) == 0) { { -return dev_storage + 473; +return dev_storage + 601; } } @@ -26467,7 +27943,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh13", 10) == 0) { { -return dev_storage + 458; +return dev_storage + 586; } } @@ -26482,7 +27958,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg13", 10) == 0) { { -return dev_storage + 443; +return dev_storage + 571; } } @@ -26497,7 +27973,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf13", 10) == 0) { { -return dev_storage + 428; +return dev_storage + 556; } } @@ -26512,7 +27988,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde13", 10) == 0) { { -return dev_storage + 413; +return dev_storage + 541; } } @@ -26530,7 +28006,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx3", 10) == 0) { { -return dev_storage + 2350; +return dev_storage + 2478; } } @@ -26545,7 +28021,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw3", 10) == 0) { { -return dev_storage + 2335; +return dev_storage + 2463; } } @@ -26560,7 +28036,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv3", 10) == 0) { { -return dev_storage + 2320; +return dev_storage + 2448; } } @@ -26575,7 +28051,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu3", 10) == 0) { { -return dev_storage + 2305; +return dev_storage + 2433; } } @@ -26590,7 +28066,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt3", 10) == 0) { { -return dev_storage + 2290; +return dev_storage + 2418; } } @@ -26605,7 +28081,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds3", 10) == 0) { { -return dev_storage + 2275; +return dev_storage + 2403; } } @@ -26620,7 +28096,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr3", 10) == 0) { { -return dev_storage + 2260; +return dev_storage + 2388; } } @@ -26635,7 +28111,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq3", 10) == 0) { { -return dev_storage + 2245; +return dev_storage + 2373; } } @@ -26650,7 +28126,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp3", 10) == 0) { { -return dev_storage + 2230; +return dev_storage + 2358; } } @@ -26665,7 +28141,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo3", 10) == 0) { { -return dev_storage + 2215; +return dev_storage + 2343; } } @@ -26680,7 +28156,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn3", 10) == 0) { { -return dev_storage + 2200; +return dev_storage + 2328; } } @@ -26695,7 +28171,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm3", 10) == 0) { { -return dev_storage + 2185; +return dev_storage + 2313; } } @@ -26710,7 +28186,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl3", 10) == 0) { { -return dev_storage + 2170; +return dev_storage + 2298; } } @@ -26725,7 +28201,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk3", 10) == 0) { { -return dev_storage + 2155; +return dev_storage + 2283; } } @@ -26740,7 +28216,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj3", 10) == 0) { { -return dev_storage + 2140; +return dev_storage + 2268; } } @@ -26755,7 +28231,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi3", 10) == 0) { { -return dev_storage + 2125; +return dev_storage + 2253; } } @@ -26770,7 +28246,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh3", 10) == 0) { { -return dev_storage + 2110; +return dev_storage + 2238; } } @@ -26785,7 +28261,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg3", 10) == 0) { { -return dev_storage + 2095; +return dev_storage + 2223; } } @@ -26800,7 +28276,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf3", 10) == 0) { { -return dev_storage + 2080; +return dev_storage + 2208; } } @@ -26815,7 +28291,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde3", 10) == 0) { { -return dev_storage + 2065; +return dev_storage + 2193; } } @@ -26830,7 +28306,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd3", 10) == 0) { { -return dev_storage + 2050; +return dev_storage + 2178; } } @@ -26845,7 +28321,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc3", 10) == 0) { { -return dev_storage + 2035; +return dev_storage + 2163; } } @@ -26860,7 +28336,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb3", 10) == 0) { { -return dev_storage + 2020; +return dev_storage + 2148; } } @@ -26875,7 +28351,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda3", 10) == 0) { { -return dev_storage + 2005; +return dev_storage + 2133; } } @@ -26893,7 +28369,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd13", 10) == 0) { { -return dev_storage + 398; +return dev_storage + 526; } } @@ -26908,7 +28384,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd13", 10) == 0) { { -return dev_storage + 312; +return dev_storage + 440; } } @@ -26938,7 +28414,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz3", 10) == 0) { { -return dev_storage + 1966; +return dev_storage + 2094; } } @@ -26953,7 +28429,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy3", 10) == 0) { { -return dev_storage + 1951; +return dev_storage + 2079; } } @@ -26968,7 +28444,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx3", 10) == 0) { { -return dev_storage + 1936; +return dev_storage + 2064; } } @@ -26983,7 +28459,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw3", 10) == 0) { { -return dev_storage + 1921; +return dev_storage + 2049; } } @@ -26998,7 +28474,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv3", 10) == 0) { { -return dev_storage + 1906; +return dev_storage + 2034; } } @@ -27013,7 +28489,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu3", 10) == 0) { { -return dev_storage + 1891; +return dev_storage + 2019; } } @@ -27028,7 +28504,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct3", 10) == 0) { { -return dev_storage + 1876; +return dev_storage + 2004; } } @@ -27043,7 +28519,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs3", 10) == 0) { { -return dev_storage + 1861; +return dev_storage + 1989; } } @@ -27058,7 +28534,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr3", 10) == 0) { { -return dev_storage + 1846; +return dev_storage + 1974; } } @@ -27073,7 +28549,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq3", 10) == 0) { { -return dev_storage + 1831; +return dev_storage + 1959; } } @@ -27088,7 +28564,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp3", 10) == 0) { { -return dev_storage + 1816; +return dev_storage + 1944; } } @@ -27103,7 +28579,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco3", 10) == 0) { { -return dev_storage + 1801; +return dev_storage + 1929; } } @@ -27118,7 +28594,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn3", 10) == 0) { { -return dev_storage + 1786; +return dev_storage + 1914; } } @@ -27133,7 +28609,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm3", 10) == 0) { { -return dev_storage + 1771; +return dev_storage + 1899; } } @@ -27148,7 +28624,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl3", 10) == 0) { { -return dev_storage + 1756; +return dev_storage + 1884; } } @@ -27163,7 +28639,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck3", 10) == 0) { { -return dev_storage + 1741; +return dev_storage + 1869; } } @@ -27178,7 +28654,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj3", 10) == 0) { { -return dev_storage + 1726; +return dev_storage + 1854; } } @@ -27193,7 +28669,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci3", 10) == 0) { { -return dev_storage + 1711; +return dev_storage + 1839; } } @@ -27208,7 +28684,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch3", 10) == 0) { { -return dev_storage + 1696; +return dev_storage + 1824; } } @@ -27223,7 +28699,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg3", 10) == 0) { { -return dev_storage + 1681; +return dev_storage + 1809; } } @@ -27238,7 +28714,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf3", 10) == 0) { { -return dev_storage + 1666; +return dev_storage + 1794; } } @@ -27253,7 +28729,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce3", 10) == 0) { { -return dev_storage + 1651; +return dev_storage + 1779; } } @@ -27268,7 +28744,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd3", 10) == 0) { { -return dev_storage + 1636; +return dev_storage + 1764; } } @@ -27283,7 +28759,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc3", 10) == 0) { { -return dev_storage + 1621; +return dev_storage + 1749; } } @@ -27298,7 +28774,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb3", 10) == 0) { { -return dev_storage + 1606; +return dev_storage + 1734; } } @@ -27313,7 +28789,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca3", 10) == 0) { { -return dev_storage + 1591; +return dev_storage + 1719; } } @@ -27328,7 +28804,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc13", 10) == 0) { { -return dev_storage + 383; +return dev_storage + 511; } } @@ -27352,7 +28828,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz3", 10) == 0) { { -return dev_storage + 1550; +return dev_storage + 1678; } } @@ -27367,7 +28843,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby3", 10) == 0) { { -return dev_storage + 1535; +return dev_storage + 1663; } } @@ -27382,7 +28858,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx3", 10) == 0) { { -return dev_storage + 1520; +return dev_storage + 1648; } } @@ -27397,7 +28873,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw3", 10) == 0) { { -return dev_storage + 1505; +return dev_storage + 1633; } } @@ -27412,7 +28888,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv3", 10) == 0) { { -return dev_storage + 1490; +return dev_storage + 1618; } } @@ -27427,7 +28903,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu3", 10) == 0) { { -return dev_storage + 1475; +return dev_storage + 1603; } } @@ -27442,7 +28918,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt3", 10) == 0) { { -return dev_storage + 1460; +return dev_storage + 1588; } } @@ -27457,7 +28933,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs3", 10) == 0) { { -return dev_storage + 1445; +return dev_storage + 1573; } } @@ -27472,7 +28948,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr3", 10) == 0) { { -return dev_storage + 1430; +return dev_storage + 1558; } } @@ -27487,7 +28963,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq3", 10) == 0) { { -return dev_storage + 1415; +return dev_storage + 1543; } } @@ -27502,7 +28978,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp3", 10) == 0) { { -return dev_storage + 1400; +return dev_storage + 1528; } } @@ -27517,7 +28993,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo3", 10) == 0) { { -return dev_storage + 1385; +return dev_storage + 1513; } } @@ -27532,7 +29008,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn3", 10) == 0) { { -return dev_storage + 1370; +return dev_storage + 1498; } } @@ -27547,7 +29023,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm3", 10) == 0) { { -return dev_storage + 1355; +return dev_storage + 1483; } } @@ -27562,7 +29038,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl3", 10) == 0) { { -return dev_storage + 1340; +return dev_storage + 1468; } } @@ -27577,7 +29053,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk3", 10) == 0) { { -return dev_storage + 1325; +return dev_storage + 1453; } } @@ -27592,7 +29068,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj3", 10) == 0) { { -return dev_storage + 1310; +return dev_storage + 1438; } } @@ -27607,7 +29083,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi3", 10) == 0) { { -return dev_storage + 1295; +return dev_storage + 1423; } } @@ -27622,7 +29098,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh3", 10) == 0) { { -return dev_storage + 1280; +return dev_storage + 1408; } } @@ -27637,7 +29113,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg3", 10) == 0) { { -return dev_storage + 1265; +return dev_storage + 1393; } } @@ -27652,7 +29128,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf3", 10) == 0) { { -return dev_storage + 1250; +return dev_storage + 1378; } } @@ -27667,7 +29143,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe3", 10) == 0) { { -return dev_storage + 1235; +return dev_storage + 1363; } } @@ -27682,7 +29158,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd3", 10) == 0) { { -return dev_storage + 1220; +return dev_storage + 1348; } } @@ -27697,7 +29173,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc3", 10) == 0) { { -return dev_storage + 1205; +return dev_storage + 1333; } } @@ -27712,7 +29188,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb3", 10) == 0) { { -return dev_storage + 1190; +return dev_storage + 1318; } } @@ -27727,7 +29203,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba3", 10) == 0) { { -return dev_storage + 1175; +return dev_storage + 1303; } } @@ -27742,7 +29218,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb13", 10) == 0) { { -return dev_storage + 368; +return dev_storage + 496; } } @@ -27766,7 +29242,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz3", 10) == 0) { { -return dev_storage + 1134; +return dev_storage + 1262; } } @@ -27781,7 +29257,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday3", 10) == 0) { { -return dev_storage + 1119; +return dev_storage + 1247; } } @@ -27796,7 +29272,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax3", 10) == 0) { { -return dev_storage + 1104; +return dev_storage + 1232; } } @@ -27811,7 +29287,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw3", 10) == 0) { { -return dev_storage + 1089; +return dev_storage + 1217; } } @@ -27826,7 +29302,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav3", 10) == 0) { { -return dev_storage + 1074; +return dev_storage + 1202; } } @@ -27841,7 +29317,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau3", 10) == 0) { { -return dev_storage + 1059; +return dev_storage + 1187; } } @@ -27856,7 +29332,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat3", 10) == 0) { { -return dev_storage + 1044; +return dev_storage + 1172; } } @@ -27871,7 +29347,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas3", 10) == 0) { { -return dev_storage + 1029; +return dev_storage + 1157; } } @@ -27886,7 +29362,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar3", 10) == 0) { { -return dev_storage + 1014; +return dev_storage + 1142; } } @@ -27901,7 +29377,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq3", 10) == 0) { { -return dev_storage + 999; +return dev_storage + 1127; } } @@ -27916,7 +29392,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap3", 10) == 0) { { -return dev_storage + 984; +return dev_storage + 1112; } } @@ -27931,7 +29407,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao3", 10) == 0) { { -return dev_storage + 969; +return dev_storage + 1097; } } @@ -27946,7 +29422,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan3", 10) == 0) { { -return dev_storage + 954; +return dev_storage + 1082; } } @@ -27961,7 +29437,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam3", 10) == 0) { { -return dev_storage + 939; +return dev_storage + 1067; } } @@ -27976,7 +29452,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal3", 10) == 0) { { -return dev_storage + 924; +return dev_storage + 1052; } } @@ -27991,7 +29467,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak3", 10) == 0) { { -return dev_storage + 909; +return dev_storage + 1037; } } @@ -28006,7 +29482,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj3", 10) == 0) { { -return dev_storage + 894; +return dev_storage + 1022; } } @@ -28021,7 +29497,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai3", 10) == 0) { { -return dev_storage + 879; +return dev_storage + 1007; } } @@ -28036,7 +29512,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah3", 10) == 0) { { -return dev_storage + 864; +return dev_storage + 992; } } @@ -28051,7 +29527,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag3", 10) == 0) { { -return dev_storage + 849; +return dev_storage + 977; } } @@ -28066,7 +29542,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf3", 10) == 0) { { -return dev_storage + 834; +return dev_storage + 962; } } @@ -28081,7 +29557,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae3", 10) == 0) { { -return dev_storage + 819; +return dev_storage + 947; } } @@ -28096,7 +29572,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad3", 10) == 0) { { -return dev_storage + 804; +return dev_storage + 932; } } @@ -28111,7 +29587,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac3", 10) == 0) { { -return dev_storage + 789; +return dev_storage + 917; } } @@ -28126,7 +29602,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab3", 10) == 0) { { -return dev_storage + 774; +return dev_storage + 902; } } @@ -28141,7 +29617,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa3", 10) == 0) { { -return dev_storage + 759; +return dev_storage + 887; } } @@ -28156,7 +29632,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda13", 10) == 0) { { -return dev_storage + 353; +return dev_storage + 481; } } @@ -28180,7 +29656,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st123", 10) == 0) { { -return dev_storage + 2502; +return dev_storage + 2630; } } @@ -28195,7 +29671,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st113", 10) == 0) { { -return dev_storage + 2492; +return dev_storage + 2620; } } @@ -28210,7 +29686,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st103", 10) == 0) { { -return dev_storage + 2482; +return dev_storage + 2610; } } @@ -28240,7 +29716,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz12", 10) == 0) { { -return dev_storage + 727; +return dev_storage + 855; } } @@ -28258,7 +29734,52 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS2", 10) == 0) { { -return dev_storage + 2510; +return dev_storage + 2638; + +} + } + else + { +{ +return NULL; + +} + } + case '9': + if (strncmp (KR_keyword, "/dev/pty92", 10) == 0) + { +{ +return dev_storage + 390; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/pty82", 10) == 0) + { +{ +return dev_storage + 380; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/pty72", 10) == 0) + { +{ +return dev_storage + 370; } } @@ -28273,7 +29794,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty62", 10) == 0) { { -return dev_storage + 296; +return dev_storage + 360; } } @@ -28288,7 +29809,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty52", 10) == 0) { { -return dev_storage + 286; +return dev_storage + 350; } } @@ -28303,7 +29824,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty42", 10) == 0) { { -return dev_storage + 276; +return dev_storage + 340; } } @@ -28318,7 +29839,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty32", 10) == 0) { { -return dev_storage + 266; +return dev_storage + 330; } } @@ -28333,7 +29854,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty22", 10) == 0) { { -return dev_storage + 256; +return dev_storage + 320; } } @@ -28351,7 +29872,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy12", 10) == 0) { { -return dev_storage + 712; +return dev_storage + 840; } } @@ -28366,7 +29887,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty12", 10) == 0) { { -return dev_storage + 246; +return dev_storage + 310; } } @@ -28393,7 +29914,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx12", 10) == 0) { { -return dev_storage + 697; +return dev_storage + 825; } } @@ -28408,7 +29929,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw12", 10) == 0) { { -return dev_storage + 682; +return dev_storage + 810; } } @@ -28423,7 +29944,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv12", 10) == 0) { { -return dev_storage + 667; +return dev_storage + 795; } } @@ -28438,7 +29959,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu12", 10) == 0) { { -return dev_storage + 652; +return dev_storage + 780; } } @@ -28456,7 +29977,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst92", 10) == 0) { { -return dev_storage + 196; +return dev_storage + 260; } } @@ -28471,7 +29992,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst82", 10) == 0) { { -return dev_storage + 186; +return dev_storage + 250; } } @@ -28486,7 +30007,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst72", 10) == 0) { { -return dev_storage + 176; +return dev_storage + 240; } } @@ -28501,7 +30022,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst62", 10) == 0) { { -return dev_storage + 166; +return dev_storage + 230; } } @@ -28516,7 +30037,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst52", 10) == 0) { { -return dev_storage + 156; +return dev_storage + 220; } } @@ -28531,7 +30052,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst42", 10) == 0) { { -return dev_storage + 146; +return dev_storage + 210; } } @@ -28546,7 +30067,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst32", 10) == 0) { { -return dev_storage + 136; +return dev_storage + 200; } } @@ -28561,7 +30082,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst22", 10) == 0) { { -return dev_storage + 126; +return dev_storage + 190; } } @@ -28579,7 +30100,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt12", 10) == 0) { { -return dev_storage + 637; +return dev_storage + 765; } } @@ -28594,7 +30115,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst12", 10) == 0) { { -return dev_storage + 116; +return dev_storage + 180; } } @@ -28621,7 +30142,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds12", 10) == 0) { { -return dev_storage + 622; +return dev_storage + 750; } } @@ -28636,7 +30157,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr12", 10) == 0) { { -return dev_storage + 607; +return dev_storage + 735; } } @@ -28651,7 +30172,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq12", 10) == 0) { { -return dev_storage + 592; +return dev_storage + 720; } } @@ -28666,7 +30187,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp12", 10) == 0) { { -return dev_storage + 577; +return dev_storage + 705; } } @@ -28681,7 +30202,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo12", 10) == 0) { { -return dev_storage + 562; +return dev_storage + 690; } } @@ -28699,7 +30220,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn12", 10) == 0) { { -return dev_storage + 547; +return dev_storage + 675; } } @@ -28738,7 +30259,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm12", 10) == 0) { { -return dev_storage + 532; +return dev_storage + 660; } } @@ -28774,7 +30295,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl12", 10) == 0) { { -return dev_storage + 517; +return dev_storage + 645; } } @@ -28789,7 +30310,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk12", 10) == 0) { { -return dev_storage + 502; +return dev_storage + 630; } } @@ -28804,7 +30325,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj12", 10) == 0) { { -return dev_storage + 487; +return dev_storage + 615; } } @@ -28819,7 +30340,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi12", 10) == 0) { { -return dev_storage + 472; +return dev_storage + 600; } } @@ -28834,7 +30355,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh12", 10) == 0) { { -return dev_storage + 457; +return dev_storage + 585; } } @@ -28849,7 +30370,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg12", 10) == 0) { { -return dev_storage + 442; +return dev_storage + 570; } } @@ -28864,7 +30385,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf12", 10) == 0) { { -return dev_storage + 427; +return dev_storage + 555; } } @@ -28879,7 +30400,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde12", 10) == 0) { { -return dev_storage + 412; +return dev_storage + 540; } } @@ -28897,7 +30418,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx2", 10) == 0) { { -return dev_storage + 2349; +return dev_storage + 2477; } } @@ -28912,7 +30433,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw2", 10) == 0) { { -return dev_storage + 2334; +return dev_storage + 2462; } } @@ -28927,7 +30448,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv2", 10) == 0) { { -return dev_storage + 2319; +return dev_storage + 2447; } } @@ -28942,7 +30463,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu2", 10) == 0) { { -return dev_storage + 2304; +return dev_storage + 2432; } } @@ -28957,7 +30478,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt2", 10) == 0) { { -return dev_storage + 2289; +return dev_storage + 2417; } } @@ -28972,7 +30493,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds2", 10) == 0) { { -return dev_storage + 2274; +return dev_storage + 2402; } } @@ -28987,7 +30508,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr2", 10) == 0) { { -return dev_storage + 2259; +return dev_storage + 2387; } } @@ -29002,7 +30523,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq2", 10) == 0) { { -return dev_storage + 2244; +return dev_storage + 2372; } } @@ -29017,7 +30538,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp2", 10) == 0) { { -return dev_storage + 2229; +return dev_storage + 2357; } } @@ -29032,7 +30553,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo2", 10) == 0) { { -return dev_storage + 2214; +return dev_storage + 2342; } } @@ -29047,7 +30568,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn2", 10) == 0) { { -return dev_storage + 2199; +return dev_storage + 2327; } } @@ -29062,7 +30583,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm2", 10) == 0) { { -return dev_storage + 2184; +return dev_storage + 2312; } } @@ -29077,7 +30598,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl2", 10) == 0) { { -return dev_storage + 2169; +return dev_storage + 2297; } } @@ -29092,7 +30613,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk2", 10) == 0) { { -return dev_storage + 2154; +return dev_storage + 2282; } } @@ -29107,7 +30628,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj2", 10) == 0) { { -return dev_storage + 2139; +return dev_storage + 2267; } } @@ -29122,7 +30643,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi2", 10) == 0) { { -return dev_storage + 2124; +return dev_storage + 2252; } } @@ -29137,7 +30658,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh2", 10) == 0) { { -return dev_storage + 2109; +return dev_storage + 2237; } } @@ -29152,7 +30673,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg2", 10) == 0) { { -return dev_storage + 2094; +return dev_storage + 2222; } } @@ -29167,7 +30688,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf2", 10) == 0) { { -return dev_storage + 2079; +return dev_storage + 2207; } } @@ -29182,7 +30703,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde2", 10) == 0) { { -return dev_storage + 2064; +return dev_storage + 2192; } } @@ -29197,7 +30718,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd2", 10) == 0) { { -return dev_storage + 2049; +return dev_storage + 2177; } } @@ -29212,7 +30733,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc2", 10) == 0) { { -return dev_storage + 2034; +return dev_storage + 2162; } } @@ -29227,7 +30748,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb2", 10) == 0) { { -return dev_storage + 2019; +return dev_storage + 2147; } } @@ -29242,7 +30763,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda2", 10) == 0) { { -return dev_storage + 2004; +return dev_storage + 2132; } } @@ -29260,7 +30781,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd12", 10) == 0) { { -return dev_storage + 397; +return dev_storage + 525; } } @@ -29275,7 +30796,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd12", 10) == 0) { { -return dev_storage + 311; +return dev_storage + 439; } } @@ -29305,7 +30826,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz2", 10) == 0) { { -return dev_storage + 1965; +return dev_storage + 2093; } } @@ -29320,7 +30841,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy2", 10) == 0) { { -return dev_storage + 1950; +return dev_storage + 2078; } } @@ -29335,7 +30856,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx2", 10) == 0) { { -return dev_storage + 1935; +return dev_storage + 2063; } } @@ -29350,7 +30871,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw2", 10) == 0) { { -return dev_storage + 1920; +return dev_storage + 2048; } } @@ -29365,7 +30886,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv2", 10) == 0) { { -return dev_storage + 1905; +return dev_storage + 2033; } } @@ -29380,7 +30901,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu2", 10) == 0) { { -return dev_storage + 1890; +return dev_storage + 2018; } } @@ -29395,7 +30916,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct2", 10) == 0) { { -return dev_storage + 1875; +return dev_storage + 2003; } } @@ -29410,7 +30931,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs2", 10) == 0) { { -return dev_storage + 1860; +return dev_storage + 1988; } } @@ -29425,7 +30946,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr2", 10) == 0) { { -return dev_storage + 1845; +return dev_storage + 1973; } } @@ -29440,7 +30961,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq2", 10) == 0) { { -return dev_storage + 1830; +return dev_storage + 1958; } } @@ -29455,7 +30976,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp2", 10) == 0) { { -return dev_storage + 1815; +return dev_storage + 1943; } } @@ -29470,7 +30991,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco2", 10) == 0) { { -return dev_storage + 1800; +return dev_storage + 1928; } } @@ -29485,7 +31006,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn2", 10) == 0) { { -return dev_storage + 1785; +return dev_storage + 1913; } } @@ -29500,7 +31021,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm2", 10) == 0) { { -return dev_storage + 1770; +return dev_storage + 1898; } } @@ -29515,7 +31036,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl2", 10) == 0) { { -return dev_storage + 1755; +return dev_storage + 1883; } } @@ -29530,7 +31051,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck2", 10) == 0) { { -return dev_storage + 1740; +return dev_storage + 1868; } } @@ -29545,7 +31066,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj2", 10) == 0) { { -return dev_storage + 1725; +return dev_storage + 1853; } } @@ -29560,7 +31081,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci2", 10) == 0) { { -return dev_storage + 1710; +return dev_storage + 1838; } } @@ -29575,7 +31096,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch2", 10) == 0) { { -return dev_storage + 1695; +return dev_storage + 1823; } } @@ -29590,7 +31111,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg2", 10) == 0) { { -return dev_storage + 1680; +return dev_storage + 1808; } } @@ -29605,7 +31126,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf2", 10) == 0) { { -return dev_storage + 1665; +return dev_storage + 1793; } } @@ -29620,7 +31141,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce2", 10) == 0) { { -return dev_storage + 1650; +return dev_storage + 1778; } } @@ -29635,7 +31156,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd2", 10) == 0) { { -return dev_storage + 1635; +return dev_storage + 1763; } } @@ -29650,7 +31171,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc2", 10) == 0) { { -return dev_storage + 1620; +return dev_storage + 1748; } } @@ -29665,7 +31186,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb2", 10) == 0) { { -return dev_storage + 1605; +return dev_storage + 1733; } } @@ -29680,7 +31201,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca2", 10) == 0) { { -return dev_storage + 1590; +return dev_storage + 1718; } } @@ -29695,7 +31216,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc12", 10) == 0) { { -return dev_storage + 382; +return dev_storage + 510; } } @@ -29719,7 +31240,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz2", 10) == 0) { { -return dev_storage + 1549; +return dev_storage + 1677; } } @@ -29734,7 +31255,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby2", 10) == 0) { { -return dev_storage + 1534; +return dev_storage + 1662; } } @@ -29749,7 +31270,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx2", 10) == 0) { { -return dev_storage + 1519; +return dev_storage + 1647; } } @@ -29764,7 +31285,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw2", 10) == 0) { { -return dev_storage + 1504; +return dev_storage + 1632; } } @@ -29779,7 +31300,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv2", 10) == 0) { { -return dev_storage + 1489; +return dev_storage + 1617; } } @@ -29794,7 +31315,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu2", 10) == 0) { { -return dev_storage + 1474; +return dev_storage + 1602; } } @@ -29809,7 +31330,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt2", 10) == 0) { { -return dev_storage + 1459; +return dev_storage + 1587; } } @@ -29824,7 +31345,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs2", 10) == 0) { { -return dev_storage + 1444; +return dev_storage + 1572; } } @@ -29839,7 +31360,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr2", 10) == 0) { { -return dev_storage + 1429; +return dev_storage + 1557; } } @@ -29854,7 +31375,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq2", 10) == 0) { { -return dev_storage + 1414; +return dev_storage + 1542; } } @@ -29869,7 +31390,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp2", 10) == 0) { { -return dev_storage + 1399; +return dev_storage + 1527; } } @@ -29884,7 +31405,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo2", 10) == 0) { { -return dev_storage + 1384; +return dev_storage + 1512; } } @@ -29899,7 +31420,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn2", 10) == 0) { { -return dev_storage + 1369; +return dev_storage + 1497; } } @@ -29914,7 +31435,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm2", 10) == 0) { { -return dev_storage + 1354; +return dev_storage + 1482; } } @@ -29929,7 +31450,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl2", 10) == 0) { { -return dev_storage + 1339; +return dev_storage + 1467; } } @@ -29944,7 +31465,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk2", 10) == 0) { { -return dev_storage + 1324; +return dev_storage + 1452; } } @@ -29959,7 +31480,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj2", 10) == 0) { { -return dev_storage + 1309; +return dev_storage + 1437; } } @@ -29974,7 +31495,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi2", 10) == 0) { { -return dev_storage + 1294; +return dev_storage + 1422; } } @@ -29989,7 +31510,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh2", 10) == 0) { { -return dev_storage + 1279; +return dev_storage + 1407; } } @@ -30004,7 +31525,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg2", 10) == 0) { { -return dev_storage + 1264; +return dev_storage + 1392; } } @@ -30019,7 +31540,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf2", 10) == 0) { { -return dev_storage + 1249; +return dev_storage + 1377; } } @@ -30034,7 +31555,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe2", 10) == 0) { { -return dev_storage + 1234; +return dev_storage + 1362; } } @@ -30049,7 +31570,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd2", 10) == 0) { { -return dev_storage + 1219; +return dev_storage + 1347; } } @@ -30064,7 +31585,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc2", 10) == 0) { { -return dev_storage + 1204; +return dev_storage + 1332; } } @@ -30079,7 +31600,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb2", 10) == 0) { { -return dev_storage + 1189; +return dev_storage + 1317; } } @@ -30094,7 +31615,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba2", 10) == 0) { { -return dev_storage + 1174; +return dev_storage + 1302; } } @@ -30109,7 +31630,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb12", 10) == 0) { { -return dev_storage + 367; +return dev_storage + 495; } } @@ -30133,7 +31654,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz2", 10) == 0) { { -return dev_storage + 1133; +return dev_storage + 1261; } } @@ -30148,7 +31669,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday2", 10) == 0) { { -return dev_storage + 1118; +return dev_storage + 1246; } } @@ -30163,7 +31684,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax2", 10) == 0) { { -return dev_storage + 1103; +return dev_storage + 1231; } } @@ -30178,7 +31699,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw2", 10) == 0) { { -return dev_storage + 1088; +return dev_storage + 1216; } } @@ -30193,7 +31714,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav2", 10) == 0) { { -return dev_storage + 1073; +return dev_storage + 1201; } } @@ -30208,7 +31729,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau2", 10) == 0) { { -return dev_storage + 1058; +return dev_storage + 1186; } } @@ -30223,7 +31744,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat2", 10) == 0) { { -return dev_storage + 1043; +return dev_storage + 1171; } } @@ -30238,7 +31759,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas2", 10) == 0) { { -return dev_storage + 1028; +return dev_storage + 1156; } } @@ -30253,7 +31774,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar2", 10) == 0) { { -return dev_storage + 1013; +return dev_storage + 1141; } } @@ -30268,7 +31789,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq2", 10) == 0) { { -return dev_storage + 998; +return dev_storage + 1126; } } @@ -30283,7 +31804,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap2", 10) == 0) { { -return dev_storage + 983; +return dev_storage + 1111; } } @@ -30298,7 +31819,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao2", 10) == 0) { { -return dev_storage + 968; +return dev_storage + 1096; } } @@ -30313,7 +31834,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan2", 10) == 0) { { -return dev_storage + 953; +return dev_storage + 1081; } } @@ -30328,7 +31849,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam2", 10) == 0) { { -return dev_storage + 938; +return dev_storage + 1066; } } @@ -30343,7 +31864,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal2", 10) == 0) { { -return dev_storage + 923; +return dev_storage + 1051; } } @@ -30358,7 +31879,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak2", 10) == 0) { { -return dev_storage + 908; +return dev_storage + 1036; } } @@ -30373,7 +31894,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj2", 10) == 0) { { -return dev_storage + 893; +return dev_storage + 1021; } } @@ -30388,7 +31909,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai2", 10) == 0) { { -return dev_storage + 878; +return dev_storage + 1006; } } @@ -30403,7 +31924,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah2", 10) == 0) { { -return dev_storage + 863; +return dev_storage + 991; } } @@ -30418,7 +31939,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag2", 10) == 0) { { -return dev_storage + 848; +return dev_storage + 976; } } @@ -30433,7 +31954,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf2", 10) == 0) { { -return dev_storage + 833; +return dev_storage + 961; } } @@ -30448,7 +31969,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae2", 10) == 0) { { -return dev_storage + 818; +return dev_storage + 946; } } @@ -30463,7 +31984,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad2", 10) == 0) { { -return dev_storage + 803; +return dev_storage + 931; } } @@ -30478,7 +31999,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac2", 10) == 0) { { -return dev_storage + 788; +return dev_storage + 916; } } @@ -30493,7 +32014,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab2", 10) == 0) { { -return dev_storage + 773; +return dev_storage + 901; } } @@ -30508,7 +32029,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa2", 10) == 0) { { -return dev_storage + 758; +return dev_storage + 886; } } @@ -30523,7 +32044,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda12", 10) == 0) { { -return dev_storage + 352; +return dev_storage + 480; } } @@ -30547,7 +32068,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st122", 10) == 0) { { -return dev_storage + 2501; +return dev_storage + 2629; } } @@ -30562,7 +32083,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st112", 10) == 0) { { -return dev_storage + 2491; +return dev_storage + 2619; } } @@ -30577,7 +32098,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st102", 10) == 0) { { -return dev_storage + 2481; +return dev_storage + 2609; } } @@ -30607,7 +32128,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz11", 10) == 0) { { -return dev_storage + 726; +return dev_storage + 854; } } @@ -30625,7 +32146,52 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS1", 10) == 0) { { -return dev_storage + 2509; +return dev_storage + 2637; + +} + } + else + { +{ +return NULL; + +} + } + case '9': + if (strncmp (KR_keyword, "/dev/pty91", 10) == 0) + { +{ +return dev_storage + 389; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/pty81", 10) == 0) + { +{ +return dev_storage + 379; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/pty71", 10) == 0) + { +{ +return dev_storage + 369; } } @@ -30640,7 +32206,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty61", 10) == 0) { { -return dev_storage + 295; +return dev_storage + 359; } } @@ -30655,7 +32221,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty51", 10) == 0) { { -return dev_storage + 285; +return dev_storage + 349; } } @@ -30670,7 +32236,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty41", 10) == 0) { { -return dev_storage + 275; +return dev_storage + 339; } } @@ -30685,7 +32251,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty31", 10) == 0) { { -return dev_storage + 265; +return dev_storage + 329; } } @@ -30700,7 +32266,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty21", 10) == 0) { { -return dev_storage + 255; +return dev_storage + 319; } } @@ -30718,7 +32284,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy11", 10) == 0) { { -return dev_storage + 711; +return dev_storage + 839; } } @@ -30733,7 +32299,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty11", 10) == 0) { { -return dev_storage + 245; +return dev_storage + 309; } } @@ -30760,7 +32326,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx11", 10) == 0) { { -return dev_storage + 696; +return dev_storage + 824; } } @@ -30775,7 +32341,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw11", 10) == 0) { { -return dev_storage + 681; +return dev_storage + 809; } } @@ -30790,7 +32356,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv11", 10) == 0) { { -return dev_storage + 666; +return dev_storage + 794; } } @@ -30805,7 +32371,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu11", 10) == 0) { { -return dev_storage + 651; +return dev_storage + 779; } } @@ -30823,7 +32389,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst91", 10) == 0) { { -return dev_storage + 195; +return dev_storage + 259; } } @@ -30838,7 +32404,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst81", 10) == 0) { { -return dev_storage + 185; +return dev_storage + 249; } } @@ -30853,7 +32419,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst71", 10) == 0) { { -return dev_storage + 175; +return dev_storage + 239; } } @@ -30868,7 +32434,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst61", 10) == 0) { { -return dev_storage + 165; +return dev_storage + 229; } } @@ -30883,7 +32449,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst51", 10) == 0) { { -return dev_storage + 155; +return dev_storage + 219; } } @@ -30898,7 +32464,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst41", 10) == 0) { { -return dev_storage + 145; +return dev_storage + 209; } } @@ -30913,7 +32479,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst31", 10) == 0) { { -return dev_storage + 135; +return dev_storage + 199; } } @@ -30928,7 +32494,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst21", 10) == 0) { { -return dev_storage + 125; +return dev_storage + 189; } } @@ -30946,7 +32512,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt11", 10) == 0) { { -return dev_storage + 636; +return dev_storage + 764; } } @@ -30961,7 +32527,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst11", 10) == 0) { { -return dev_storage + 115; +return dev_storage + 179; } } @@ -30988,7 +32554,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds11", 10) == 0) { { -return dev_storage + 621; +return dev_storage + 749; } } @@ -31003,7 +32569,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr11", 10) == 0) { { -return dev_storage + 606; +return dev_storage + 734; } } @@ -31018,7 +32584,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq11", 10) == 0) { { -return dev_storage + 591; +return dev_storage + 719; } } @@ -31033,7 +32599,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp11", 10) == 0) { { -return dev_storage + 576; +return dev_storage + 704; } } @@ -31048,7 +32614,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo11", 10) == 0) { { -return dev_storage + 561; +return dev_storage + 689; } } @@ -31066,7 +32632,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn11", 10) == 0) { { -return dev_storage + 546; +return dev_storage + 674; } } @@ -31105,7 +32671,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm11", 10) == 0) { { -return dev_storage + 531; +return dev_storage + 659; } } @@ -31141,7 +32707,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl11", 10) == 0) { { -return dev_storage + 516; +return dev_storage + 644; } } @@ -31156,7 +32722,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk11", 10) == 0) { { -return dev_storage + 501; +return dev_storage + 629; } } @@ -31171,7 +32737,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj11", 10) == 0) { { -return dev_storage + 486; +return dev_storage + 614; } } @@ -31186,7 +32752,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi11", 10) == 0) { { -return dev_storage + 471; +return dev_storage + 599; } } @@ -31201,7 +32767,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh11", 10) == 0) { { -return dev_storage + 456; +return dev_storage + 584; } } @@ -31216,7 +32782,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg11", 10) == 0) { { -return dev_storage + 441; +return dev_storage + 569; } } @@ -31231,7 +32797,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf11", 10) == 0) { { -return dev_storage + 426; +return dev_storage + 554; } } @@ -31246,7 +32812,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde11", 10) == 0) { { -return dev_storage + 411; +return dev_storage + 539; } } @@ -31264,7 +32830,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx1", 10) == 0) { { -return dev_storage + 2348; +return dev_storage + 2476; } } @@ -31279,7 +32845,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw1", 10) == 0) { { -return dev_storage + 2333; +return dev_storage + 2461; } } @@ -31294,7 +32860,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv1", 10) == 0) { { -return dev_storage + 2318; +return dev_storage + 2446; } } @@ -31309,7 +32875,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu1", 10) == 0) { { -return dev_storage + 2303; +return dev_storage + 2431; } } @@ -31324,7 +32890,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt1", 10) == 0) { { -return dev_storage + 2288; +return dev_storage + 2416; } } @@ -31339,7 +32905,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds1", 10) == 0) { { -return dev_storage + 2273; +return dev_storage + 2401; } } @@ -31354,7 +32920,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr1", 10) == 0) { { -return dev_storage + 2258; +return dev_storage + 2386; } } @@ -31369,7 +32935,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq1", 10) == 0) { { -return dev_storage + 2243; +return dev_storage + 2371; } } @@ -31384,7 +32950,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp1", 10) == 0) { { -return dev_storage + 2228; +return dev_storage + 2356; } } @@ -31399,7 +32965,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo1", 10) == 0) { { -return dev_storage + 2213; +return dev_storage + 2341; } } @@ -31414,7 +32980,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn1", 10) == 0) { { -return dev_storage + 2198; +return dev_storage + 2326; } } @@ -31429,7 +32995,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm1", 10) == 0) { { -return dev_storage + 2183; +return dev_storage + 2311; } } @@ -31444,7 +33010,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl1", 10) == 0) { { -return dev_storage + 2168; +return dev_storage + 2296; } } @@ -31459,7 +33025,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk1", 10) == 0) { { -return dev_storage + 2153; +return dev_storage + 2281; } } @@ -31474,7 +33040,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj1", 10) == 0) { { -return dev_storage + 2138; +return dev_storage + 2266; } } @@ -31489,7 +33055,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi1", 10) == 0) { { -return dev_storage + 2123; +return dev_storage + 2251; } } @@ -31504,7 +33070,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh1", 10) == 0) { { -return dev_storage + 2108; +return dev_storage + 2236; } } @@ -31519,7 +33085,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg1", 10) == 0) { { -return dev_storage + 2093; +return dev_storage + 2221; } } @@ -31534,7 +33100,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf1", 10) == 0) { { -return dev_storage + 2078; +return dev_storage + 2206; } } @@ -31549,7 +33115,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde1", 10) == 0) { { -return dev_storage + 2063; +return dev_storage + 2191; } } @@ -31564,7 +33130,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd1", 10) == 0) { { -return dev_storage + 2048; +return dev_storage + 2176; } } @@ -31579,7 +33145,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc1", 10) == 0) { { -return dev_storage + 2033; +return dev_storage + 2161; } } @@ -31594,7 +33160,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb1", 10) == 0) { { -return dev_storage + 2018; +return dev_storage + 2146; } } @@ -31609,7 +33175,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda1", 10) == 0) { { -return dev_storage + 2003; +return dev_storage + 2131; } } @@ -31627,7 +33193,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd11", 10) == 0) { { -return dev_storage + 396; +return dev_storage + 524; } } @@ -31642,7 +33208,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd11", 10) == 0) { { -return dev_storage + 310; +return dev_storage + 438; } } @@ -31672,7 +33238,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz1", 10) == 0) { { -return dev_storage + 1964; +return dev_storage + 2092; } } @@ -31687,7 +33253,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy1", 10) == 0) { { -return dev_storage + 1949; +return dev_storage + 2077; } } @@ -31702,7 +33268,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx1", 10) == 0) { { -return dev_storage + 1934; +return dev_storage + 2062; } } @@ -31717,7 +33283,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw1", 10) == 0) { { -return dev_storage + 1919; +return dev_storage + 2047; } } @@ -31732,7 +33298,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv1", 10) == 0) { { -return dev_storage + 1904; +return dev_storage + 2032; } } @@ -31747,7 +33313,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu1", 10) == 0) { { -return dev_storage + 1889; +return dev_storage + 2017; } } @@ -31762,7 +33328,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct1", 10) == 0) { { -return dev_storage + 1874; +return dev_storage + 2002; } } @@ -31777,7 +33343,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs1", 10) == 0) { { -return dev_storage + 1859; +return dev_storage + 1987; } } @@ -31792,7 +33358,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr1", 10) == 0) { { -return dev_storage + 1844; +return dev_storage + 1972; } } @@ -31807,7 +33373,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq1", 10) == 0) { { -return dev_storage + 1829; +return dev_storage + 1957; } } @@ -31822,7 +33388,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp1", 10) == 0) { { -return dev_storage + 1814; +return dev_storage + 1942; } } @@ -31837,7 +33403,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco1", 10) == 0) { { -return dev_storage + 1799; +return dev_storage + 1927; } } @@ -31852,7 +33418,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn1", 10) == 0) { { -return dev_storage + 1784; +return dev_storage + 1912; } } @@ -31867,7 +33433,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm1", 10) == 0) { { -return dev_storage + 1769; +return dev_storage + 1897; } } @@ -31882,7 +33448,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl1", 10) == 0) { { -return dev_storage + 1754; +return dev_storage + 1882; } } @@ -31897,7 +33463,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck1", 10) == 0) { { -return dev_storage + 1739; +return dev_storage + 1867; } } @@ -31912,7 +33478,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj1", 10) == 0) { { -return dev_storage + 1724; +return dev_storage + 1852; } } @@ -31927,7 +33493,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci1", 10) == 0) { { -return dev_storage + 1709; +return dev_storage + 1837; } } @@ -31942,7 +33508,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch1", 10) == 0) { { -return dev_storage + 1694; +return dev_storage + 1822; } } @@ -31957,7 +33523,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg1", 10) == 0) { { -return dev_storage + 1679; +return dev_storage + 1807; } } @@ -31972,7 +33538,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf1", 10) == 0) { { -return dev_storage + 1664; +return dev_storage + 1792; } } @@ -31987,7 +33553,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce1", 10) == 0) { { -return dev_storage + 1649; +return dev_storage + 1777; } } @@ -32002,7 +33568,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd1", 10) == 0) { { -return dev_storage + 1634; +return dev_storage + 1762; } } @@ -32017,7 +33583,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc1", 10) == 0) { { -return dev_storage + 1619; +return dev_storage + 1747; } } @@ -32032,7 +33598,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb1", 10) == 0) { { -return dev_storage + 1604; +return dev_storage + 1732; } } @@ -32047,7 +33613,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca1", 10) == 0) { { -return dev_storage + 1589; +return dev_storage + 1717; } } @@ -32062,7 +33628,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc11", 10) == 0) { { -return dev_storage + 381; +return dev_storage + 509; } } @@ -32086,7 +33652,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz1", 10) == 0) { { -return dev_storage + 1548; +return dev_storage + 1676; } } @@ -32101,7 +33667,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby1", 10) == 0) { { -return dev_storage + 1533; +return dev_storage + 1661; } } @@ -32116,7 +33682,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx1", 10) == 0) { { -return dev_storage + 1518; +return dev_storage + 1646; } } @@ -32131,7 +33697,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw1", 10) == 0) { { -return dev_storage + 1503; +return dev_storage + 1631; } } @@ -32146,7 +33712,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv1", 10) == 0) { { -return dev_storage + 1488; +return dev_storage + 1616; } } @@ -32161,7 +33727,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu1", 10) == 0) { { -return dev_storage + 1473; +return dev_storage + 1601; } } @@ -32176,7 +33742,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt1", 10) == 0) { { -return dev_storage + 1458; +return dev_storage + 1586; } } @@ -32191,7 +33757,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs1", 10) == 0) { { -return dev_storage + 1443; +return dev_storage + 1571; } } @@ -32206,7 +33772,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr1", 10) == 0) { { -return dev_storage + 1428; +return dev_storage + 1556; } } @@ -32221,7 +33787,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq1", 10) == 0) { { -return dev_storage + 1413; +return dev_storage + 1541; } } @@ -32236,7 +33802,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp1", 10) == 0) { { -return dev_storage + 1398; +return dev_storage + 1526; } } @@ -32251,7 +33817,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo1", 10) == 0) { { -return dev_storage + 1383; +return dev_storage + 1511; } } @@ -32266,7 +33832,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn1", 10) == 0) { { -return dev_storage + 1368; +return dev_storage + 1496; } } @@ -32281,7 +33847,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm1", 10) == 0) { { -return dev_storage + 1353; +return dev_storage + 1481; } } @@ -32296,7 +33862,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl1", 10) == 0) { { -return dev_storage + 1338; +return dev_storage + 1466; } } @@ -32311,7 +33877,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk1", 10) == 0) { { -return dev_storage + 1323; +return dev_storage + 1451; } } @@ -32326,7 +33892,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj1", 10) == 0) { { -return dev_storage + 1308; +return dev_storage + 1436; } } @@ -32341,7 +33907,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi1", 10) == 0) { { -return dev_storage + 1293; +return dev_storage + 1421; } } @@ -32356,7 +33922,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh1", 10) == 0) { { -return dev_storage + 1278; +return dev_storage + 1406; } } @@ -32371,7 +33937,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg1", 10) == 0) { { -return dev_storage + 1263; +return dev_storage + 1391; } } @@ -32386,7 +33952,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf1", 10) == 0) { { -return dev_storage + 1248; +return dev_storage + 1376; } } @@ -32401,7 +33967,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe1", 10) == 0) { { -return dev_storage + 1233; +return dev_storage + 1361; } } @@ -32416,7 +33982,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd1", 10) == 0) { { -return dev_storage + 1218; +return dev_storage + 1346; } } @@ -32431,7 +33997,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc1", 10) == 0) { { -return dev_storage + 1203; +return dev_storage + 1331; } } @@ -32446,7 +34012,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb1", 10) == 0) { { -return dev_storage + 1188; +return dev_storage + 1316; } } @@ -32461,7 +34027,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba1", 10) == 0) { { -return dev_storage + 1173; +return dev_storage + 1301; } } @@ -32476,7 +34042,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb11", 10) == 0) { { -return dev_storage + 366; +return dev_storage + 494; } } @@ -32500,7 +34066,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz1", 10) == 0) { { -return dev_storage + 1132; +return dev_storage + 1260; } } @@ -32515,7 +34081,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday1", 10) == 0) { { -return dev_storage + 1117; +return dev_storage + 1245; } } @@ -32530,7 +34096,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax1", 10) == 0) { { -return dev_storage + 1102; +return dev_storage + 1230; } } @@ -32545,7 +34111,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw1", 10) == 0) { { -return dev_storage + 1087; +return dev_storage + 1215; } } @@ -32560,7 +34126,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav1", 10) == 0) { { -return dev_storage + 1072; +return dev_storage + 1200; } } @@ -32575,7 +34141,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau1", 10) == 0) { { -return dev_storage + 1057; +return dev_storage + 1185; } } @@ -32590,7 +34156,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat1", 10) == 0) { { -return dev_storage + 1042; +return dev_storage + 1170; } } @@ -32605,7 +34171,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas1", 10) == 0) { { -return dev_storage + 1027; +return dev_storage + 1155; } } @@ -32620,7 +34186,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar1", 10) == 0) { { -return dev_storage + 1012; +return dev_storage + 1140; } } @@ -32635,7 +34201,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq1", 10) == 0) { { -return dev_storage + 997; +return dev_storage + 1125; } } @@ -32650,7 +34216,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap1", 10) == 0) { { -return dev_storage + 982; +return dev_storage + 1110; } } @@ -32665,7 +34231,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao1", 10) == 0) { { -return dev_storage + 967; +return dev_storage + 1095; } } @@ -32680,7 +34246,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan1", 10) == 0) { { -return dev_storage + 952; +return dev_storage + 1080; } } @@ -32695,7 +34261,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam1", 10) == 0) { { -return dev_storage + 937; +return dev_storage + 1065; } } @@ -32710,7 +34276,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal1", 10) == 0) { { -return dev_storage + 922; +return dev_storage + 1050; } } @@ -32725,7 +34291,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak1", 10) == 0) { { -return dev_storage + 907; +return dev_storage + 1035; } } @@ -32740,7 +34306,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj1", 10) == 0) { { -return dev_storage + 892; +return dev_storage + 1020; } } @@ -32755,7 +34321,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai1", 10) == 0) { { -return dev_storage + 877; +return dev_storage + 1005; } } @@ -32770,7 +34336,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah1", 10) == 0) { { -return dev_storage + 862; +return dev_storage + 990; } } @@ -32785,7 +34351,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag1", 10) == 0) { { -return dev_storage + 847; +return dev_storage + 975; } } @@ -32800,7 +34366,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf1", 10) == 0) { { -return dev_storage + 832; +return dev_storage + 960; } } @@ -32815,7 +34381,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae1", 10) == 0) { { -return dev_storage + 817; +return dev_storage + 945; } } @@ -32830,7 +34396,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad1", 10) == 0) { { -return dev_storage + 802; +return dev_storage + 930; } } @@ -32845,7 +34411,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac1", 10) == 0) { { -return dev_storage + 787; +return dev_storage + 915; } } @@ -32860,7 +34426,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab1", 10) == 0) { { -return dev_storage + 772; +return dev_storage + 900; } } @@ -32875,7 +34441,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa1", 10) == 0) { { -return dev_storage + 757; +return dev_storage + 885; } } @@ -32890,7 +34456,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda11", 10) == 0) { { -return dev_storage + 351; +return dev_storage + 479; } } @@ -32914,7 +34480,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st121", 10) == 0) { { -return dev_storage + 2500; +return dev_storage + 2628; } } @@ -32929,7 +34495,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st111", 10) == 0) { { -return dev_storage + 2490; +return dev_storage + 2618; } } @@ -32944,7 +34510,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st101", 10) == 0) { { -return dev_storage + 2480; +return dev_storage + 2608; } } @@ -32974,7 +34540,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdz10", 10) == 0) { { -return dev_storage + 725; +return dev_storage + 853; } } @@ -32992,7 +34558,52 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS0", 10) == 0) { { -return dev_storage + 2508; +return dev_storage + 2636; + +} + } + else + { +{ +return NULL; + +} + } + case '9': + if (strncmp (KR_keyword, "/dev/pty90", 10) == 0) + { +{ +return dev_storage + 388; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/pty80", 10) == 0) + { +{ +return dev_storage + 378; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/pty70", 10) == 0) + { +{ +return dev_storage + 368; } } @@ -33007,7 +34618,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty60", 10) == 0) { { -return dev_storage + 294; +return dev_storage + 358; } } @@ -33022,7 +34633,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty50", 10) == 0) { { -return dev_storage + 284; +return dev_storage + 348; } } @@ -33037,7 +34648,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty40", 10) == 0) { { -return dev_storage + 274; +return dev_storage + 338; } } @@ -33052,7 +34663,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty30", 10) == 0) { { -return dev_storage + 264; +return dev_storage + 328; } } @@ -33067,7 +34678,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty20", 10) == 0) { { -return dev_storage + 254; +return dev_storage + 318; } } @@ -33085,7 +34696,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdy10", 10) == 0) { { -return dev_storage + 710; +return dev_storage + 838; } } @@ -33100,7 +34711,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/pty10", 10) == 0) { { -return dev_storage + 244; +return dev_storage + 308; } } @@ -33127,7 +34738,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdx10", 10) == 0) { { -return dev_storage + 695; +return dev_storage + 823; } } @@ -33142,7 +34753,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdw10", 10) == 0) { { -return dev_storage + 680; +return dev_storage + 808; } } @@ -33157,7 +34768,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdv10", 10) == 0) { { -return dev_storage + 665; +return dev_storage + 793; } } @@ -33172,7 +34783,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdu10", 10) == 0) { { -return dev_storage + 650; +return dev_storage + 778; } } @@ -33190,7 +34801,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst90", 10) == 0) { { -return dev_storage + 194; +return dev_storage + 258; } } @@ -33205,7 +34816,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst80", 10) == 0) { { -return dev_storage + 184; +return dev_storage + 248; } } @@ -33220,7 +34831,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst70", 10) == 0) { { -return dev_storage + 174; +return dev_storage + 238; } } @@ -33235,7 +34846,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst60", 10) == 0) { { -return dev_storage + 164; +return dev_storage + 228; } } @@ -33250,7 +34861,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst50", 10) == 0) { { -return dev_storage + 154; +return dev_storage + 218; } } @@ -33265,7 +34876,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst40", 10) == 0) { { -return dev_storage + 144; +return dev_storage + 208; } } @@ -33280,7 +34891,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst30", 10) == 0) { { -return dev_storage + 134; +return dev_storage + 198; } } @@ -33295,7 +34906,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst20", 10) == 0) { { -return dev_storage + 124; +return dev_storage + 188; } } @@ -33313,7 +34924,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdt10", 10) == 0) { { -return dev_storage + 635; +return dev_storage + 763; } } @@ -33328,7 +34939,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst10", 10) == 0) { { -return dev_storage + 114; +return dev_storage + 178; } } @@ -33355,7 +34966,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sds10", 10) == 0) { { -return dev_storage + 620; +return dev_storage + 748; } } @@ -33370,7 +34981,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdr10", 10) == 0) { { -return dev_storage + 605; +return dev_storage + 733; } } @@ -33385,7 +34996,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdq10", 10) == 0) { { -return dev_storage + 590; +return dev_storage + 718; } } @@ -33400,7 +35011,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdp10", 10) == 0) { { -return dev_storage + 575; +return dev_storage + 703; } } @@ -33415,7 +35026,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdo10", 10) == 0) { { -return dev_storage + 560; +return dev_storage + 688; } } @@ -33433,7 +35044,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdn10", 10) == 0) { { -return dev_storage + 545; +return dev_storage + 673; } } @@ -33472,7 +35083,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdm10", 10) == 0) { { -return dev_storage + 530; +return dev_storage + 658; } } @@ -33508,7 +35119,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdl10", 10) == 0) { { -return dev_storage + 515; +return dev_storage + 643; } } @@ -33523,7 +35134,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdk10", 10) == 0) { { -return dev_storage + 500; +return dev_storage + 628; } } @@ -33538,7 +35149,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdj10", 10) == 0) { { -return dev_storage + 485; +return dev_storage + 613; } } @@ -33553,7 +35164,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdi10", 10) == 0) { { -return dev_storage + 470; +return dev_storage + 598; } } @@ -33568,7 +35179,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdh10", 10) == 0) { { -return dev_storage + 455; +return dev_storage + 583; } } @@ -33583,7 +35194,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdg10", 10) == 0) { { -return dev_storage + 440; +return dev_storage + 568; } } @@ -33598,7 +35209,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdf10", 10) == 0) { { -return dev_storage + 425; +return dev_storage + 553; } } @@ -33613,7 +35224,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sde10", 10) == 0) { { -return dev_storage + 410; +return dev_storage + 538; } } @@ -33631,7 +35242,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdd10", 10) == 0) { { -return dev_storage + 395; +return dev_storage + 523; } } @@ -33646,7 +35257,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/scd10", 10) == 0) { { -return dev_storage + 309; +return dev_storage + 437; } } @@ -33667,7 +35278,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdc10", 10) == 0) { { -return dev_storage + 380; +return dev_storage + 508; } } @@ -33682,7 +35293,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdb10", 10) == 0) { { -return dev_storage + 365; +return dev_storage + 493; } } @@ -33697,7 +35308,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sda10", 10) == 0) { { -return dev_storage + 350; +return dev_storage + 478; } } @@ -33715,7 +35326,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st120", 10) == 0) { { -return dev_storage + 2499; +return dev_storage + 2627; } } @@ -33730,7 +35341,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st110", 10) == 0) { { -return dev_storage + 2489; +return dev_storage + 2617; } } @@ -33745,7 +35356,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/st100", 10) == 0) { { -return dev_storage + 2479; +return dev_storage + 2607; } } @@ -33796,7 +35407,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/random", 11) == 0) { { -return dev_storage + 298; +return dev_storage + 426; } } @@ -33810,6 +35421,66 @@ return NULL; case '9': switch (KR_keyword [9]) { + case '9': + if (strncmp (KR_keyword, "/dev/cons99", 11) == 0) + { +{ +return dev_storage + 119; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/cons89", 11) == 0) + { +{ +return dev_storage + 109; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/cons79", 11) == 0) + { +{ +return dev_storage + 99; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, "/dev/cons69", 11) == 0) + { +{ +return dev_storage + 89; + +} + } + else + { +{ +return NULL; + +} + } case '5': switch (KR_keyword [5]) { @@ -33817,7 +35488,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS59", 11) == 0) { { -return dev_storage + 2567; +return dev_storage + 2695; } } @@ -33856,7 +35527,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS49", 11) == 0) { { -return dev_storage + 2557; +return dev_storage + 2685; } } @@ -33895,7 +35566,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS39", 11) == 0) { { -return dev_storage + 2547; +return dev_storage + 2675; } } @@ -33934,7 +35605,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS29", 11) == 0) { { -return dev_storage + 2537; +return dev_storage + 2665; } } @@ -33973,7 +35644,22 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS19", 11) == 0) { { -return dev_storage + 2527; +return dev_storage + 2655; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty119", 11) == 0) + { +{ +return dev_storage + 417; } } @@ -33988,7 +35674,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst119", 11) == 0) { { -return dev_storage + 223; +return dev_storage + 287; } } @@ -34021,15 +35707,39 @@ return NULL; } } case '0': - if (strncmp (KR_keyword, "/dev/nst109", 11) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty109", 11) == 0) + { { -return dev_storage + 213; +return dev_storage + 407; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst109", 11) == 0) + { +{ +return dev_storage + 277; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; @@ -34044,6 +35754,66 @@ return NULL; case '8': switch (KR_keyword [9]) { + case '9': + if (strncmp (KR_keyword, "/dev/cons98", 11) == 0) + { +{ +return dev_storage + 118; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/cons88", 11) == 0) + { +{ +return dev_storage + 108; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/cons78", 11) == 0) + { +{ +return dev_storage + 98; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, "/dev/cons68", 11) == 0) + { +{ +return dev_storage + 88; + +} + } + else + { +{ +return NULL; + +} + } case '5': switch (KR_keyword [5]) { @@ -34051,7 +35821,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS58", 11) == 0) { { -return dev_storage + 2566; +return dev_storage + 2694; } } @@ -34090,7 +35860,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS48", 11) == 0) { { -return dev_storage + 2556; +return dev_storage + 2684; } } @@ -34129,7 +35899,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS38", 11) == 0) { { -return dev_storage + 2546; +return dev_storage + 2674; } } @@ -34168,7 +35938,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS28", 11) == 0) { { -return dev_storage + 2536; +return dev_storage + 2664; } } @@ -34207,7 +35977,22 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS18", 11) == 0) { { -return dev_storage + 2526; +return dev_storage + 2654; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty118", 11) == 0) + { +{ +return dev_storage + 416; } } @@ -34222,7 +36007,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst118", 11) == 0) { { -return dev_storage + 222; +return dev_storage + 286; } } @@ -34255,15 +36040,39 @@ return NULL; } } case '0': - if (strncmp (KR_keyword, "/dev/nst108", 11) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty108", 11) == 0) + { { -return dev_storage + 212; +return dev_storage + 406; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst108", 11) == 0) + { +{ +return dev_storage + 276; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; @@ -34278,6 +36087,66 @@ return NULL; case '7': switch (KR_keyword [9]) { + case '9': + if (strncmp (KR_keyword, "/dev/cons97", 11) == 0) + { +{ +return dev_storage + 117; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/cons87", 11) == 0) + { +{ +return dev_storage + 107; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/cons77", 11) == 0) + { +{ +return dev_storage + 97; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, "/dev/cons67", 11) == 0) + { +{ +return dev_storage + 87; + +} + } + else + { +{ +return NULL; + +} + } case '5': switch (KR_keyword [5]) { @@ -34285,7 +36154,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS57", 11) == 0) { { -return dev_storage + 2565; +return dev_storage + 2693; } } @@ -34324,7 +36193,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS47", 11) == 0) { { -return dev_storage + 2555; +return dev_storage + 2683; } } @@ -34363,7 +36232,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS37", 11) == 0) { { -return dev_storage + 2545; +return dev_storage + 2673; } } @@ -34402,7 +36271,22 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS27", 11) == 0) { { -return dev_storage + 2535; +return dev_storage + 2663; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty127", 11) == 0) + { +{ +return dev_storage + 425; } } @@ -34417,7 +36301,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst127", 11) == 0) { { -return dev_storage + 231; +return dev_storage + 295; } } @@ -34456,7 +36340,22 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS17", 11) == 0) { { -return dev_storage + 2525; +return dev_storage + 2653; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty117", 11) == 0) + { +{ +return dev_storage + 415; } } @@ -34471,7 +36370,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst117", 11) == 0) { { -return dev_storage + 221; +return dev_storage + 285; } } @@ -34504,15 +36403,39 @@ return NULL; } } case '0': - if (strncmp (KR_keyword, "/dev/nst107", 11) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty107", 11) == 0) + { { -return dev_storage + 211; +return dev_storage + 405; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst107", 11) == 0) + { +{ +return dev_storage + 275; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; @@ -34527,6 +36450,66 @@ return NULL; case '6': switch (KR_keyword [9]) { + case '9': + if (strncmp (KR_keyword, "/dev/cons96", 11) == 0) + { +{ +return dev_storage + 116; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/cons86", 11) == 0) + { +{ +return dev_storage + 106; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/cons76", 11) == 0) + { +{ +return dev_storage + 96; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, "/dev/cons66", 11) == 0) + { +{ +return dev_storage + 86; + +} + } + else + { +{ +return NULL; + +} + } case '5': switch (KR_keyword [5]) { @@ -34534,7 +36517,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS56", 11) == 0) { { -return dev_storage + 2564; +return dev_storage + 2692; } } @@ -34573,7 +36556,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS46", 11) == 0) { { -return dev_storage + 2554; +return dev_storage + 2682; } } @@ -34612,7 +36595,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS36", 11) == 0) { { -return dev_storage + 2544; +return dev_storage + 2672; } } @@ -34651,7 +36634,22 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS26", 11) == 0) { { -return dev_storage + 2534; +return dev_storage + 2662; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty126", 11) == 0) + { +{ +return dev_storage + 424; } } @@ -34666,7 +36664,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst126", 11) == 0) { { -return dev_storage + 230; +return dev_storage + 294; } } @@ -34705,7 +36703,22 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS16", 11) == 0) { { -return dev_storage + 2524; +return dev_storage + 2652; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty116", 11) == 0) + { +{ +return dev_storage + 414; } } @@ -34720,7 +36733,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst116", 11) == 0) { { -return dev_storage + 220; +return dev_storage + 284; } } @@ -34753,15 +36766,39 @@ return NULL; } } case '0': - if (strncmp (KR_keyword, "/dev/nst106", 11) == 0) + switch (KR_keyword [5]) { + case 'p': + if (strncmp (KR_keyword, "/dev/pty106", 11) == 0) + { { -return dev_storage + 210; +return dev_storage + 404; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'n': + if (strncmp (KR_keyword, "/dev/nst106", 11) == 0) + { +{ +return dev_storage + 274; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; @@ -34783,7 +36820,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS55", 11) == 0) { { -return dev_storage + 2563; +return dev_storage + 2691; } } @@ -34798,7 +36835,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS45", 11) == 0) { { -return dev_storage + 2553; +return dev_storage + 2681; } } @@ -34813,7 +36850,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS35", 11) == 0) { { -return dev_storage + 2543; +return dev_storage + 2671; } } @@ -34825,25 +36862,88 @@ return NULL; } } case '2': - if (strncmp (KR_keyword, "/dev/ttyS25", 11) == 0) + switch (KR_keyword [5]) { + case 't': + if (strncmp (KR_keyword, "/dev/ttyS25", 11) == 0) + { { -return dev_storage + 2533; +return dev_storage + 2661; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty125", 11) == 0) + { +{ +return dev_storage + 423; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '1': - if (strncmp (KR_keyword, "/dev/ttyS15", 11) == 0) + switch (KR_keyword [5]) + { + case 't': + if (strncmp (KR_keyword, "/dev/ttyS15", 11) == 0) + { +{ +return dev_storage + 2651; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty115", 11) == 0) + { +{ +return dev_storage + 413; + +} + } + else + { +{ +return NULL; + +} + } + default: +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, "/dev/pty105", 11) == 0) { { -return dev_storage + 2523; +return dev_storage + 403; } } @@ -34867,7 +36967,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst125", 11) == 0) { { -return dev_storage + 229; +return dev_storage + 293; } } @@ -34882,7 +36982,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst115", 11) == 0) { { -return dev_storage + 219; +return dev_storage + 283; } } @@ -34897,7 +36997,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst105", 11) == 0) { { -return dev_storage + 209; +return dev_storage + 273; } } @@ -34917,6 +37017,66 @@ return NULL; case 'n': switch (KR_keyword [9]) { + case '9': + if (strncmp (KR_keyword, "/dev/cons95", 11) == 0) + { +{ +return dev_storage + 115; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/cons85", 11) == 0) + { +{ +return dev_storage + 105; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/cons75", 11) == 0) + { +{ +return dev_storage + 95; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, "/dev/cons65", 11) == 0) + { +{ +return dev_storage + 85; + +} + } + else + { +{ +return NULL; + +} + } case '5': if (strncmp (KR_keyword, "/dev/cons55", 11) == 0) { @@ -35005,7 +37165,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx15", 11) == 0) { { -return dev_storage + 2362; +return dev_storage + 2490; } } @@ -35020,7 +37180,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw15", 11) == 0) { { -return dev_storage + 2347; +return dev_storage + 2475; } } @@ -35035,7 +37195,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv15", 11) == 0) { { -return dev_storage + 2332; +return dev_storage + 2460; } } @@ -35050,7 +37210,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu15", 11) == 0) { { -return dev_storage + 2317; +return dev_storage + 2445; } } @@ -35065,7 +37225,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt15", 11) == 0) { { -return dev_storage + 2302; +return dev_storage + 2430; } } @@ -35080,7 +37240,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds15", 11) == 0) { { -return dev_storage + 2287; +return dev_storage + 2415; } } @@ -35095,7 +37255,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr15", 11) == 0) { { -return dev_storage + 2272; +return dev_storage + 2400; } } @@ -35110,7 +37270,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq15", 11) == 0) { { -return dev_storage + 2257; +return dev_storage + 2385; } } @@ -35125,7 +37285,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp15", 11) == 0) { { -return dev_storage + 2242; +return dev_storage + 2370; } } @@ -35140,7 +37300,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo15", 11) == 0) { { -return dev_storage + 2227; +return dev_storage + 2355; } } @@ -35155,7 +37315,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn15", 11) == 0) { { -return dev_storage + 2212; +return dev_storage + 2340; } } @@ -35170,7 +37330,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm15", 11) == 0) { { -return dev_storage + 2197; +return dev_storage + 2325; } } @@ -35185,7 +37345,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl15", 11) == 0) { { -return dev_storage + 2182; +return dev_storage + 2310; } } @@ -35200,7 +37360,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk15", 11) == 0) { { -return dev_storage + 2167; +return dev_storage + 2295; } } @@ -35215,7 +37375,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj15", 11) == 0) { { -return dev_storage + 2152; +return dev_storage + 2280; } } @@ -35230,7 +37390,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi15", 11) == 0) { { -return dev_storage + 2137; +return dev_storage + 2265; } } @@ -35245,7 +37405,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh15", 11) == 0) { { -return dev_storage + 2122; +return dev_storage + 2250; } } @@ -35260,7 +37420,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg15", 11) == 0) { { -return dev_storage + 2107; +return dev_storage + 2235; } } @@ -35275,7 +37435,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf15", 11) == 0) { { -return dev_storage + 2092; +return dev_storage + 2220; } } @@ -35290,7 +37450,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde15", 11) == 0) { { -return dev_storage + 2077; +return dev_storage + 2205; } } @@ -35305,7 +37465,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd15", 11) == 0) { { -return dev_storage + 2062; +return dev_storage + 2190; } } @@ -35320,7 +37480,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc15", 11) == 0) { { -return dev_storage + 2047; +return dev_storage + 2175; } } @@ -35335,7 +37495,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb15", 11) == 0) { { -return dev_storage + 2032; +return dev_storage + 2160; } } @@ -35350,7 +37510,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda15", 11) == 0) { { -return dev_storage + 2017; +return dev_storage + 2145; } } @@ -35374,7 +37534,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz15", 11) == 0) { { -return dev_storage + 1978; +return dev_storage + 2106; } } @@ -35389,7 +37549,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy15", 11) == 0) { { -return dev_storage + 1963; +return dev_storage + 2091; } } @@ -35404,7 +37564,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx15", 11) == 0) { { -return dev_storage + 1948; +return dev_storage + 2076; } } @@ -35419,7 +37579,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw15", 11) == 0) { { -return dev_storage + 1933; +return dev_storage + 2061; } } @@ -35434,7 +37594,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv15", 11) == 0) { { -return dev_storage + 1918; +return dev_storage + 2046; } } @@ -35449,7 +37609,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu15", 11) == 0) { { -return dev_storage + 1903; +return dev_storage + 2031; } } @@ -35464,7 +37624,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct15", 11) == 0) { { -return dev_storage + 1888; +return dev_storage + 2016; } } @@ -35479,7 +37639,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs15", 11) == 0) { { -return dev_storage + 1873; +return dev_storage + 2001; } } @@ -35494,7 +37654,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr15", 11) == 0) { { -return dev_storage + 1858; +return dev_storage + 1986; } } @@ -35509,7 +37669,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq15", 11) == 0) { { -return dev_storage + 1843; +return dev_storage + 1971; } } @@ -35524,7 +37684,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp15", 11) == 0) { { -return dev_storage + 1828; +return dev_storage + 1956; } } @@ -35539,7 +37699,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco15", 11) == 0) { { -return dev_storage + 1813; +return dev_storage + 1941; } } @@ -35554,7 +37714,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn15", 11) == 0) { { -return dev_storage + 1798; +return dev_storage + 1926; } } @@ -35569,7 +37729,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm15", 11) == 0) { { -return dev_storage + 1783; +return dev_storage + 1911; } } @@ -35584,7 +37744,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl15", 11) == 0) { { -return dev_storage + 1768; +return dev_storage + 1896; } } @@ -35599,7 +37759,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck15", 11) == 0) { { -return dev_storage + 1753; +return dev_storage + 1881; } } @@ -35614,7 +37774,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj15", 11) == 0) { { -return dev_storage + 1738; +return dev_storage + 1866; } } @@ -35629,7 +37789,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci15", 11) == 0) { { -return dev_storage + 1723; +return dev_storage + 1851; } } @@ -35644,7 +37804,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch15", 11) == 0) { { -return dev_storage + 1708; +return dev_storage + 1836; } } @@ -35659,7 +37819,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg15", 11) == 0) { { -return dev_storage + 1693; +return dev_storage + 1821; } } @@ -35674,7 +37834,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf15", 11) == 0) { { -return dev_storage + 1678; +return dev_storage + 1806; } } @@ -35689,7 +37849,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce15", 11) == 0) { { -return dev_storage + 1663; +return dev_storage + 1791; } } @@ -35704,7 +37864,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd15", 11) == 0) { { -return dev_storage + 1648; +return dev_storage + 1776; } } @@ -35719,7 +37879,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc15", 11) == 0) { { -return dev_storage + 1633; +return dev_storage + 1761; } } @@ -35734,7 +37894,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb15", 11) == 0) { { -return dev_storage + 1618; +return dev_storage + 1746; } } @@ -35749,7 +37909,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca15", 11) == 0) { { -return dev_storage + 1603; +return dev_storage + 1731; } } @@ -35773,7 +37933,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz15", 11) == 0) { { -return dev_storage + 1562; +return dev_storage + 1690; } } @@ -35788,7 +37948,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby15", 11) == 0) { { -return dev_storage + 1547; +return dev_storage + 1675; } } @@ -35803,7 +37963,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx15", 11) == 0) { { -return dev_storage + 1532; +return dev_storage + 1660; } } @@ -35818,7 +37978,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw15", 11) == 0) { { -return dev_storage + 1517; +return dev_storage + 1645; } } @@ -35833,7 +37993,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv15", 11) == 0) { { -return dev_storage + 1502; +return dev_storage + 1630; } } @@ -35848,7 +38008,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu15", 11) == 0) { { -return dev_storage + 1487; +return dev_storage + 1615; } } @@ -35863,7 +38023,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt15", 11) == 0) { { -return dev_storage + 1472; +return dev_storage + 1600; } } @@ -35878,7 +38038,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs15", 11) == 0) { { -return dev_storage + 1457; +return dev_storage + 1585; } } @@ -35893,7 +38053,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr15", 11) == 0) { { -return dev_storage + 1442; +return dev_storage + 1570; } } @@ -35908,7 +38068,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq15", 11) == 0) { { -return dev_storage + 1427; +return dev_storage + 1555; } } @@ -35923,7 +38083,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp15", 11) == 0) { { -return dev_storage + 1412; +return dev_storage + 1540; } } @@ -35938,7 +38098,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo15", 11) == 0) { { -return dev_storage + 1397; +return dev_storage + 1525; } } @@ -35953,7 +38113,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn15", 11) == 0) { { -return dev_storage + 1382; +return dev_storage + 1510; } } @@ -35968,7 +38128,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm15", 11) == 0) { { -return dev_storage + 1367; +return dev_storage + 1495; } } @@ -35983,7 +38143,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl15", 11) == 0) { { -return dev_storage + 1352; +return dev_storage + 1480; } } @@ -35998,7 +38158,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk15", 11) == 0) { { -return dev_storage + 1337; +return dev_storage + 1465; } } @@ -36013,7 +38173,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj15", 11) == 0) { { -return dev_storage + 1322; +return dev_storage + 1450; } } @@ -36028,7 +38188,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi15", 11) == 0) { { -return dev_storage + 1307; +return dev_storage + 1435; } } @@ -36043,7 +38203,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh15", 11) == 0) { { -return dev_storage + 1292; +return dev_storage + 1420; } } @@ -36058,7 +38218,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg15", 11) == 0) { { -return dev_storage + 1277; +return dev_storage + 1405; } } @@ -36073,7 +38233,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf15", 11) == 0) { { -return dev_storage + 1262; +return dev_storage + 1390; } } @@ -36088,7 +38248,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe15", 11) == 0) { { -return dev_storage + 1247; +return dev_storage + 1375; } } @@ -36103,7 +38263,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd15", 11) == 0) { { -return dev_storage + 1232; +return dev_storage + 1360; } } @@ -36118,7 +38278,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc15", 11) == 0) { { -return dev_storage + 1217; +return dev_storage + 1345; } } @@ -36133,7 +38293,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb15", 11) == 0) { { -return dev_storage + 1202; +return dev_storage + 1330; } } @@ -36148,7 +38308,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba15", 11) == 0) { { -return dev_storage + 1187; +return dev_storage + 1315; } } @@ -36172,7 +38332,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz15", 11) == 0) { { -return dev_storage + 1146; +return dev_storage + 1274; } } @@ -36187,7 +38347,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday15", 11) == 0) { { -return dev_storage + 1131; +return dev_storage + 1259; } } @@ -36202,7 +38362,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax15", 11) == 0) { { -return dev_storage + 1116; +return dev_storage + 1244; } } @@ -36217,7 +38377,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw15", 11) == 0) { { -return dev_storage + 1101; +return dev_storage + 1229; } } @@ -36232,7 +38392,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav15", 11) == 0) { { -return dev_storage + 1086; +return dev_storage + 1214; } } @@ -36247,7 +38407,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau15", 11) == 0) { { -return dev_storage + 1071; +return dev_storage + 1199; } } @@ -36262,7 +38422,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat15", 11) == 0) { { -return dev_storage + 1056; +return dev_storage + 1184; } } @@ -36277,7 +38437,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas15", 11) == 0) { { -return dev_storage + 1041; +return dev_storage + 1169; } } @@ -36292,7 +38452,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar15", 11) == 0) { { -return dev_storage + 1026; +return dev_storage + 1154; } } @@ -36307,7 +38467,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq15", 11) == 0) { { -return dev_storage + 1011; +return dev_storage + 1139; } } @@ -36322,7 +38482,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap15", 11) == 0) { { -return dev_storage + 996; +return dev_storage + 1124; } } @@ -36337,7 +38497,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao15", 11) == 0) { { -return dev_storage + 981; +return dev_storage + 1109; } } @@ -36352,7 +38512,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan15", 11) == 0) { { -return dev_storage + 966; +return dev_storage + 1094; } } @@ -36367,7 +38527,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam15", 11) == 0) { { -return dev_storage + 951; +return dev_storage + 1079; } } @@ -36382,7 +38542,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal15", 11) == 0) { { -return dev_storage + 936; +return dev_storage + 1064; } } @@ -36397,7 +38557,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak15", 11) == 0) { { -return dev_storage + 921; +return dev_storage + 1049; } } @@ -36412,7 +38572,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj15", 11) == 0) { { -return dev_storage + 906; +return dev_storage + 1034; } } @@ -36427,7 +38587,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai15", 11) == 0) { { -return dev_storage + 891; +return dev_storage + 1019; } } @@ -36442,7 +38602,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah15", 11) == 0) { { -return dev_storage + 876; +return dev_storage + 1004; } } @@ -36457,7 +38617,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag15", 11) == 0) { { -return dev_storage + 861; +return dev_storage + 989; } } @@ -36472,7 +38632,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf15", 11) == 0) { { -return dev_storage + 846; +return dev_storage + 974; } } @@ -36487,7 +38647,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae15", 11) == 0) { { -return dev_storage + 831; +return dev_storage + 959; } } @@ -36502,7 +38662,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad15", 11) == 0) { { -return dev_storage + 816; +return dev_storage + 944; } } @@ -36517,7 +38677,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac15", 11) == 0) { { -return dev_storage + 801; +return dev_storage + 929; } } @@ -36532,7 +38692,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab15", 11) == 0) { { -return dev_storage + 786; +return dev_storage + 914; } } @@ -36547,7 +38707,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa15", 11) == 0) { { -return dev_storage + 771; +return dev_storage + 899; } } @@ -36580,7 +38740,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS54", 11) == 0) { { -return dev_storage + 2562; +return dev_storage + 2690; } } @@ -36595,7 +38755,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS44", 11) == 0) { { -return dev_storage + 2552; +return dev_storage + 2680; } } @@ -36610,7 +38770,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS34", 11) == 0) { { -return dev_storage + 2542; +return dev_storage + 2670; } } @@ -36622,25 +38782,88 @@ return NULL; } } case '2': - if (strncmp (KR_keyword, "/dev/ttyS24", 11) == 0) + switch (KR_keyword [5]) { + case 't': + if (strncmp (KR_keyword, "/dev/ttyS24", 11) == 0) + { { -return dev_storage + 2532; +return dev_storage + 2660; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty124", 11) == 0) + { +{ +return dev_storage + 422; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '1': - if (strncmp (KR_keyword, "/dev/ttyS14", 11) == 0) + switch (KR_keyword [5]) + { + case 't': + if (strncmp (KR_keyword, "/dev/ttyS14", 11) == 0) + { +{ +return dev_storage + 2650; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty114", 11) == 0) + { +{ +return dev_storage + 412; + +} + } + else + { +{ +return NULL; + +} + } + default: +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, "/dev/pty104", 11) == 0) { { -return dev_storage + 2522; +return dev_storage + 402; } } @@ -36664,7 +38887,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst124", 11) == 0) { { -return dev_storage + 228; +return dev_storage + 292; } } @@ -36679,7 +38902,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst114", 11) == 0) { { -return dev_storage + 218; +return dev_storage + 282; } } @@ -36694,7 +38917,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst104", 11) == 0) { { -return dev_storage + 208; +return dev_storage + 272; } } @@ -36714,6 +38937,66 @@ return NULL; case 'n': switch (KR_keyword [9]) { + case '9': + if (strncmp (KR_keyword, "/dev/cons94", 11) == 0) + { +{ +return dev_storage + 114; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/cons84", 11) == 0) + { +{ +return dev_storage + 104; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/cons74", 11) == 0) + { +{ +return dev_storage + 94; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, "/dev/cons64", 11) == 0) + { +{ +return dev_storage + 84; + +} + } + else + { +{ +return NULL; + +} + } case '5': if (strncmp (KR_keyword, "/dev/cons54", 11) == 0) { @@ -36802,7 +39085,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx14", 11) == 0) { { -return dev_storage + 2361; +return dev_storage + 2489; } } @@ -36817,7 +39100,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw14", 11) == 0) { { -return dev_storage + 2346; +return dev_storage + 2474; } } @@ -36832,7 +39115,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv14", 11) == 0) { { -return dev_storage + 2331; +return dev_storage + 2459; } } @@ -36847,7 +39130,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu14", 11) == 0) { { -return dev_storage + 2316; +return dev_storage + 2444; } } @@ -36862,7 +39145,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt14", 11) == 0) { { -return dev_storage + 2301; +return dev_storage + 2429; } } @@ -36877,7 +39160,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds14", 11) == 0) { { -return dev_storage + 2286; +return dev_storage + 2414; } } @@ -36892,7 +39175,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr14", 11) == 0) { { -return dev_storage + 2271; +return dev_storage + 2399; } } @@ -36907,7 +39190,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq14", 11) == 0) { { -return dev_storage + 2256; +return dev_storage + 2384; } } @@ -36922,7 +39205,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp14", 11) == 0) { { -return dev_storage + 2241; +return dev_storage + 2369; } } @@ -36937,7 +39220,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo14", 11) == 0) { { -return dev_storage + 2226; +return dev_storage + 2354; } } @@ -36952,7 +39235,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn14", 11) == 0) { { -return dev_storage + 2211; +return dev_storage + 2339; } } @@ -36967,7 +39250,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm14", 11) == 0) { { -return dev_storage + 2196; +return dev_storage + 2324; } } @@ -36982,7 +39265,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl14", 11) == 0) { { -return dev_storage + 2181; +return dev_storage + 2309; } } @@ -36997,7 +39280,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk14", 11) == 0) { { -return dev_storage + 2166; +return dev_storage + 2294; } } @@ -37012,7 +39295,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj14", 11) == 0) { { -return dev_storage + 2151; +return dev_storage + 2279; } } @@ -37027,7 +39310,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi14", 11) == 0) { { -return dev_storage + 2136; +return dev_storage + 2264; } } @@ -37042,7 +39325,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh14", 11) == 0) { { -return dev_storage + 2121; +return dev_storage + 2249; } } @@ -37057,7 +39340,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg14", 11) == 0) { { -return dev_storage + 2106; +return dev_storage + 2234; } } @@ -37072,7 +39355,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf14", 11) == 0) { { -return dev_storage + 2091; +return dev_storage + 2219; } } @@ -37087,7 +39370,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde14", 11) == 0) { { -return dev_storage + 2076; +return dev_storage + 2204; } } @@ -37102,7 +39385,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd14", 11) == 0) { { -return dev_storage + 2061; +return dev_storage + 2189; } } @@ -37117,7 +39400,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc14", 11) == 0) { { -return dev_storage + 2046; +return dev_storage + 2174; } } @@ -37132,7 +39415,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb14", 11) == 0) { { -return dev_storage + 2031; +return dev_storage + 2159; } } @@ -37147,7 +39430,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda14", 11) == 0) { { -return dev_storage + 2016; +return dev_storage + 2144; } } @@ -37171,7 +39454,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz14", 11) == 0) { { -return dev_storage + 1977; +return dev_storage + 2105; } } @@ -37186,7 +39469,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy14", 11) == 0) { { -return dev_storage + 1962; +return dev_storage + 2090; } } @@ -37201,7 +39484,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx14", 11) == 0) { { -return dev_storage + 1947; +return dev_storage + 2075; } } @@ -37216,7 +39499,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw14", 11) == 0) { { -return dev_storage + 1932; +return dev_storage + 2060; } } @@ -37231,7 +39514,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv14", 11) == 0) { { -return dev_storage + 1917; +return dev_storage + 2045; } } @@ -37246,7 +39529,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu14", 11) == 0) { { -return dev_storage + 1902; +return dev_storage + 2030; } } @@ -37261,7 +39544,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct14", 11) == 0) { { -return dev_storage + 1887; +return dev_storage + 2015; } } @@ -37276,7 +39559,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs14", 11) == 0) { { -return dev_storage + 1872; +return dev_storage + 2000; } } @@ -37291,7 +39574,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr14", 11) == 0) { { -return dev_storage + 1857; +return dev_storage + 1985; } } @@ -37306,7 +39589,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq14", 11) == 0) { { -return dev_storage + 1842; +return dev_storage + 1970; } } @@ -37321,7 +39604,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp14", 11) == 0) { { -return dev_storage + 1827; +return dev_storage + 1955; } } @@ -37336,7 +39619,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco14", 11) == 0) { { -return dev_storage + 1812; +return dev_storage + 1940; } } @@ -37351,7 +39634,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn14", 11) == 0) { { -return dev_storage + 1797; +return dev_storage + 1925; } } @@ -37366,7 +39649,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm14", 11) == 0) { { -return dev_storage + 1782; +return dev_storage + 1910; } } @@ -37381,7 +39664,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl14", 11) == 0) { { -return dev_storage + 1767; +return dev_storage + 1895; } } @@ -37396,7 +39679,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck14", 11) == 0) { { -return dev_storage + 1752; +return dev_storage + 1880; } } @@ -37411,7 +39694,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj14", 11) == 0) { { -return dev_storage + 1737; +return dev_storage + 1865; } } @@ -37426,7 +39709,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci14", 11) == 0) { { -return dev_storage + 1722; +return dev_storage + 1850; } } @@ -37441,7 +39724,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch14", 11) == 0) { { -return dev_storage + 1707; +return dev_storage + 1835; } } @@ -37456,7 +39739,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg14", 11) == 0) { { -return dev_storage + 1692; +return dev_storage + 1820; } } @@ -37471,7 +39754,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf14", 11) == 0) { { -return dev_storage + 1677; +return dev_storage + 1805; } } @@ -37486,7 +39769,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce14", 11) == 0) { { -return dev_storage + 1662; +return dev_storage + 1790; } } @@ -37501,7 +39784,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd14", 11) == 0) { { -return dev_storage + 1647; +return dev_storage + 1775; } } @@ -37516,7 +39799,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc14", 11) == 0) { { -return dev_storage + 1632; +return dev_storage + 1760; } } @@ -37531,7 +39814,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb14", 11) == 0) { { -return dev_storage + 1617; +return dev_storage + 1745; } } @@ -37546,7 +39829,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca14", 11) == 0) { { -return dev_storage + 1602; +return dev_storage + 1730; } } @@ -37570,7 +39853,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz14", 11) == 0) { { -return dev_storage + 1561; +return dev_storage + 1689; } } @@ -37585,7 +39868,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby14", 11) == 0) { { -return dev_storage + 1546; +return dev_storage + 1674; } } @@ -37600,7 +39883,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx14", 11) == 0) { { -return dev_storage + 1531; +return dev_storage + 1659; } } @@ -37615,7 +39898,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw14", 11) == 0) { { -return dev_storage + 1516; +return dev_storage + 1644; } } @@ -37630,7 +39913,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv14", 11) == 0) { { -return dev_storage + 1501; +return dev_storage + 1629; } } @@ -37645,7 +39928,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu14", 11) == 0) { { -return dev_storage + 1486; +return dev_storage + 1614; } } @@ -37660,7 +39943,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt14", 11) == 0) { { -return dev_storage + 1471; +return dev_storage + 1599; } } @@ -37675,7 +39958,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs14", 11) == 0) { { -return dev_storage + 1456; +return dev_storage + 1584; } } @@ -37690,7 +39973,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr14", 11) == 0) { { -return dev_storage + 1441; +return dev_storage + 1569; } } @@ -37705,7 +39988,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq14", 11) == 0) { { -return dev_storage + 1426; +return dev_storage + 1554; } } @@ -37720,7 +40003,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp14", 11) == 0) { { -return dev_storage + 1411; +return dev_storage + 1539; } } @@ -37735,7 +40018,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo14", 11) == 0) { { -return dev_storage + 1396; +return dev_storage + 1524; } } @@ -37750,7 +40033,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn14", 11) == 0) { { -return dev_storage + 1381; +return dev_storage + 1509; } } @@ -37765,7 +40048,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm14", 11) == 0) { { -return dev_storage + 1366; +return dev_storage + 1494; } } @@ -37780,7 +40063,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl14", 11) == 0) { { -return dev_storage + 1351; +return dev_storage + 1479; } } @@ -37795,7 +40078,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk14", 11) == 0) { { -return dev_storage + 1336; +return dev_storage + 1464; } } @@ -37810,7 +40093,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj14", 11) == 0) { { -return dev_storage + 1321; +return dev_storage + 1449; } } @@ -37825,7 +40108,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi14", 11) == 0) { { -return dev_storage + 1306; +return dev_storage + 1434; } } @@ -37840,7 +40123,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh14", 11) == 0) { { -return dev_storage + 1291; +return dev_storage + 1419; } } @@ -37855,7 +40138,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg14", 11) == 0) { { -return dev_storage + 1276; +return dev_storage + 1404; } } @@ -37870,7 +40153,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf14", 11) == 0) { { -return dev_storage + 1261; +return dev_storage + 1389; } } @@ -37885,7 +40168,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe14", 11) == 0) { { -return dev_storage + 1246; +return dev_storage + 1374; } } @@ -37900,7 +40183,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd14", 11) == 0) { { -return dev_storage + 1231; +return dev_storage + 1359; } } @@ -37915,7 +40198,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc14", 11) == 0) { { -return dev_storage + 1216; +return dev_storage + 1344; } } @@ -37930,7 +40213,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb14", 11) == 0) { { -return dev_storage + 1201; +return dev_storage + 1329; } } @@ -37945,7 +40228,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba14", 11) == 0) { { -return dev_storage + 1186; +return dev_storage + 1314; } } @@ -37969,7 +40252,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz14", 11) == 0) { { -return dev_storage + 1145; +return dev_storage + 1273; } } @@ -37984,7 +40267,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday14", 11) == 0) { { -return dev_storage + 1130; +return dev_storage + 1258; } } @@ -37999,7 +40282,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax14", 11) == 0) { { -return dev_storage + 1115; +return dev_storage + 1243; } } @@ -38014,7 +40297,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw14", 11) == 0) { { -return dev_storage + 1100; +return dev_storage + 1228; } } @@ -38029,7 +40312,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav14", 11) == 0) { { -return dev_storage + 1085; +return dev_storage + 1213; } } @@ -38044,7 +40327,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau14", 11) == 0) { { -return dev_storage + 1070; +return dev_storage + 1198; } } @@ -38059,7 +40342,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat14", 11) == 0) { { -return dev_storage + 1055; +return dev_storage + 1183; } } @@ -38074,7 +40357,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas14", 11) == 0) { { -return dev_storage + 1040; +return dev_storage + 1168; } } @@ -38089,7 +40372,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar14", 11) == 0) { { -return dev_storage + 1025; +return dev_storage + 1153; } } @@ -38104,7 +40387,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq14", 11) == 0) { { -return dev_storage + 1010; +return dev_storage + 1138; } } @@ -38119,7 +40402,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap14", 11) == 0) { { -return dev_storage + 995; +return dev_storage + 1123; } } @@ -38134,7 +40417,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao14", 11) == 0) { { -return dev_storage + 980; +return dev_storage + 1108; } } @@ -38149,7 +40432,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan14", 11) == 0) { { -return dev_storage + 965; +return dev_storage + 1093; } } @@ -38164,7 +40447,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam14", 11) == 0) { { -return dev_storage + 950; +return dev_storage + 1078; } } @@ -38179,7 +40462,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal14", 11) == 0) { { -return dev_storage + 935; +return dev_storage + 1063; } } @@ -38194,7 +40477,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak14", 11) == 0) { { -return dev_storage + 920; +return dev_storage + 1048; } } @@ -38209,7 +40492,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj14", 11) == 0) { { -return dev_storage + 905; +return dev_storage + 1033; } } @@ -38224,7 +40507,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai14", 11) == 0) { { -return dev_storage + 890; +return dev_storage + 1018; } } @@ -38239,7 +40522,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah14", 11) == 0) { { -return dev_storage + 875; +return dev_storage + 1003; } } @@ -38254,7 +40537,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag14", 11) == 0) { { -return dev_storage + 860; +return dev_storage + 988; } } @@ -38269,7 +40552,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf14", 11) == 0) { { -return dev_storage + 845; +return dev_storage + 973; } } @@ -38284,7 +40567,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae14", 11) == 0) { { -return dev_storage + 830; +return dev_storage + 958; } } @@ -38299,7 +40582,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad14", 11) == 0) { { -return dev_storage + 815; +return dev_storage + 943; } } @@ -38314,7 +40597,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac14", 11) == 0) { { -return dev_storage + 800; +return dev_storage + 928; } } @@ -38329,7 +40612,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab14", 11) == 0) { { -return dev_storage + 785; +return dev_storage + 913; } } @@ -38344,7 +40627,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa14", 11) == 0) { { -return dev_storage + 770; +return dev_storage + 898; } } @@ -38377,7 +40660,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS63", 11) == 0) { { -return dev_storage + 2571; +return dev_storage + 2699; } } @@ -38392,7 +40675,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS53", 11) == 0) { { -return dev_storage + 2561; +return dev_storage + 2689; } } @@ -38407,7 +40690,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS43", 11) == 0) { { -return dev_storage + 2551; +return dev_storage + 2679; } } @@ -38422,7 +40705,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS33", 11) == 0) { { -return dev_storage + 2541; +return dev_storage + 2669; } } @@ -38434,25 +40717,88 @@ return NULL; } } case '2': - if (strncmp (KR_keyword, "/dev/ttyS23", 11) == 0) + switch (KR_keyword [5]) { + case 't': + if (strncmp (KR_keyword, "/dev/ttyS23", 11) == 0) + { { -return dev_storage + 2531; +return dev_storage + 2659; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty123", 11) == 0) + { +{ +return dev_storage + 421; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '1': - if (strncmp (KR_keyword, "/dev/ttyS13", 11) == 0) + switch (KR_keyword [5]) + { + case 't': + if (strncmp (KR_keyword, "/dev/ttyS13", 11) == 0) + { +{ +return dev_storage + 2649; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty113", 11) == 0) + { +{ +return dev_storage + 411; + +} + } + else + { +{ +return NULL; + +} + } + default: +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, "/dev/pty103", 11) == 0) { { -return dev_storage + 2521; +return dev_storage + 401; } } @@ -38476,7 +40822,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst123", 11) == 0) { { -return dev_storage + 227; +return dev_storage + 291; } } @@ -38491,7 +40837,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst113", 11) == 0) { { -return dev_storage + 217; +return dev_storage + 281; } } @@ -38506,7 +40852,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst103", 11) == 0) { { -return dev_storage + 207; +return dev_storage + 271; } } @@ -38526,6 +40872,51 @@ return NULL; case 'n': switch (KR_keyword [9]) { + case '9': + if (strncmp (KR_keyword, "/dev/cons93", 11) == 0) + { +{ +return dev_storage + 113; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/cons83", 11) == 0) + { +{ +return dev_storage + 103; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/cons73", 11) == 0) + { +{ +return dev_storage + 93; + +} + } + else + { +{ +return NULL; + +} + } case '6': if (strncmp (KR_keyword, "/dev/cons63", 11) == 0) { @@ -38629,7 +41020,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx13", 11) == 0) { { -return dev_storage + 2360; +return dev_storage + 2488; } } @@ -38644,7 +41035,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw13", 11) == 0) { { -return dev_storage + 2345; +return dev_storage + 2473; } } @@ -38659,7 +41050,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv13", 11) == 0) { { -return dev_storage + 2330; +return dev_storage + 2458; } } @@ -38674,7 +41065,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu13", 11) == 0) { { -return dev_storage + 2315; +return dev_storage + 2443; } } @@ -38689,7 +41080,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt13", 11) == 0) { { -return dev_storage + 2300; +return dev_storage + 2428; } } @@ -38704,7 +41095,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds13", 11) == 0) { { -return dev_storage + 2285; +return dev_storage + 2413; } } @@ -38719,7 +41110,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr13", 11) == 0) { { -return dev_storage + 2270; +return dev_storage + 2398; } } @@ -38734,7 +41125,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq13", 11) == 0) { { -return dev_storage + 2255; +return dev_storage + 2383; } } @@ -38749,7 +41140,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp13", 11) == 0) { { -return dev_storage + 2240; +return dev_storage + 2368; } } @@ -38764,7 +41155,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo13", 11) == 0) { { -return dev_storage + 2225; +return dev_storage + 2353; } } @@ -38779,7 +41170,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn13", 11) == 0) { { -return dev_storage + 2210; +return dev_storage + 2338; } } @@ -38794,7 +41185,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm13", 11) == 0) { { -return dev_storage + 2195; +return dev_storage + 2323; } } @@ -38809,7 +41200,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl13", 11) == 0) { { -return dev_storage + 2180; +return dev_storage + 2308; } } @@ -38824,7 +41215,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk13", 11) == 0) { { -return dev_storage + 2165; +return dev_storage + 2293; } } @@ -38839,7 +41230,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj13", 11) == 0) { { -return dev_storage + 2150; +return dev_storage + 2278; } } @@ -38854,7 +41245,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi13", 11) == 0) { { -return dev_storage + 2135; +return dev_storage + 2263; } } @@ -38869,7 +41260,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh13", 11) == 0) { { -return dev_storage + 2120; +return dev_storage + 2248; } } @@ -38884,7 +41275,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg13", 11) == 0) { { -return dev_storage + 2105; +return dev_storage + 2233; } } @@ -38899,7 +41290,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf13", 11) == 0) { { -return dev_storage + 2090; +return dev_storage + 2218; } } @@ -38914,7 +41305,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde13", 11) == 0) { { -return dev_storage + 2075; +return dev_storage + 2203; } } @@ -38929,7 +41320,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd13", 11) == 0) { { -return dev_storage + 2060; +return dev_storage + 2188; } } @@ -38944,7 +41335,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc13", 11) == 0) { { -return dev_storage + 2045; +return dev_storage + 2173; } } @@ -38959,7 +41350,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb13", 11) == 0) { { -return dev_storage + 2030; +return dev_storage + 2158; } } @@ -38974,7 +41365,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda13", 11) == 0) { { -return dev_storage + 2015; +return dev_storage + 2143; } } @@ -38998,7 +41389,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz13", 11) == 0) { { -return dev_storage + 1976; +return dev_storage + 2104; } } @@ -39013,7 +41404,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy13", 11) == 0) { { -return dev_storage + 1961; +return dev_storage + 2089; } } @@ -39028,7 +41419,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx13", 11) == 0) { { -return dev_storage + 1946; +return dev_storage + 2074; } } @@ -39043,7 +41434,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw13", 11) == 0) { { -return dev_storage + 1931; +return dev_storage + 2059; } } @@ -39058,7 +41449,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv13", 11) == 0) { { -return dev_storage + 1916; +return dev_storage + 2044; } } @@ -39073,7 +41464,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu13", 11) == 0) { { -return dev_storage + 1901; +return dev_storage + 2029; } } @@ -39088,7 +41479,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct13", 11) == 0) { { -return dev_storage + 1886; +return dev_storage + 2014; } } @@ -39103,7 +41494,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs13", 11) == 0) { { -return dev_storage + 1871; +return dev_storage + 1999; } } @@ -39118,7 +41509,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr13", 11) == 0) { { -return dev_storage + 1856; +return dev_storage + 1984; } } @@ -39133,7 +41524,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq13", 11) == 0) { { -return dev_storage + 1841; +return dev_storage + 1969; } } @@ -39148,7 +41539,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp13", 11) == 0) { { -return dev_storage + 1826; +return dev_storage + 1954; } } @@ -39163,7 +41554,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco13", 11) == 0) { { -return dev_storage + 1811; +return dev_storage + 1939; } } @@ -39178,7 +41569,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn13", 11) == 0) { { -return dev_storage + 1796; +return dev_storage + 1924; } } @@ -39193,7 +41584,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm13", 11) == 0) { { -return dev_storage + 1781; +return dev_storage + 1909; } } @@ -39208,7 +41599,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl13", 11) == 0) { { -return dev_storage + 1766; +return dev_storage + 1894; } } @@ -39223,7 +41614,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck13", 11) == 0) { { -return dev_storage + 1751; +return dev_storage + 1879; } } @@ -39238,7 +41629,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj13", 11) == 0) { { -return dev_storage + 1736; +return dev_storage + 1864; } } @@ -39253,7 +41644,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci13", 11) == 0) { { -return dev_storage + 1721; +return dev_storage + 1849; } } @@ -39268,7 +41659,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch13", 11) == 0) { { -return dev_storage + 1706; +return dev_storage + 1834; } } @@ -39283,7 +41674,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg13", 11) == 0) { { -return dev_storage + 1691; +return dev_storage + 1819; } } @@ -39298,7 +41689,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf13", 11) == 0) { { -return dev_storage + 1676; +return dev_storage + 1804; } } @@ -39313,7 +41704,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce13", 11) == 0) { { -return dev_storage + 1661; +return dev_storage + 1789; } } @@ -39328,7 +41719,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd13", 11) == 0) { { -return dev_storage + 1646; +return dev_storage + 1774; } } @@ -39343,7 +41734,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc13", 11) == 0) { { -return dev_storage + 1631; +return dev_storage + 1759; } } @@ -39358,7 +41749,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb13", 11) == 0) { { -return dev_storage + 1616; +return dev_storage + 1744; } } @@ -39373,7 +41764,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca13", 11) == 0) { { -return dev_storage + 1601; +return dev_storage + 1729; } } @@ -39397,7 +41788,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz13", 11) == 0) { { -return dev_storage + 1560; +return dev_storage + 1688; } } @@ -39412,7 +41803,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby13", 11) == 0) { { -return dev_storage + 1545; +return dev_storage + 1673; } } @@ -39427,7 +41818,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx13", 11) == 0) { { -return dev_storage + 1530; +return dev_storage + 1658; } } @@ -39442,7 +41833,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw13", 11) == 0) { { -return dev_storage + 1515; +return dev_storage + 1643; } } @@ -39457,7 +41848,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv13", 11) == 0) { { -return dev_storage + 1500; +return dev_storage + 1628; } } @@ -39472,7 +41863,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu13", 11) == 0) { { -return dev_storage + 1485; +return dev_storage + 1613; } } @@ -39487,7 +41878,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt13", 11) == 0) { { -return dev_storage + 1470; +return dev_storage + 1598; } } @@ -39502,7 +41893,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs13", 11) == 0) { { -return dev_storage + 1455; +return dev_storage + 1583; } } @@ -39517,7 +41908,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr13", 11) == 0) { { -return dev_storage + 1440; +return dev_storage + 1568; } } @@ -39532,7 +41923,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq13", 11) == 0) { { -return dev_storage + 1425; +return dev_storage + 1553; } } @@ -39547,7 +41938,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp13", 11) == 0) { { -return dev_storage + 1410; +return dev_storage + 1538; } } @@ -39562,7 +41953,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo13", 11) == 0) { { -return dev_storage + 1395; +return dev_storage + 1523; } } @@ -39577,7 +41968,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn13", 11) == 0) { { -return dev_storage + 1380; +return dev_storage + 1508; } } @@ -39592,7 +41983,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm13", 11) == 0) { { -return dev_storage + 1365; +return dev_storage + 1493; } } @@ -39607,7 +41998,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl13", 11) == 0) { { -return dev_storage + 1350; +return dev_storage + 1478; } } @@ -39622,7 +42013,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk13", 11) == 0) { { -return dev_storage + 1335; +return dev_storage + 1463; } } @@ -39637,7 +42028,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj13", 11) == 0) { { -return dev_storage + 1320; +return dev_storage + 1448; } } @@ -39652,7 +42043,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi13", 11) == 0) { { -return dev_storage + 1305; +return dev_storage + 1433; } } @@ -39667,7 +42058,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh13", 11) == 0) { { -return dev_storage + 1290; +return dev_storage + 1418; } } @@ -39682,7 +42073,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg13", 11) == 0) { { -return dev_storage + 1275; +return dev_storage + 1403; } } @@ -39697,7 +42088,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf13", 11) == 0) { { -return dev_storage + 1260; +return dev_storage + 1388; } } @@ -39712,7 +42103,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe13", 11) == 0) { { -return dev_storage + 1245; +return dev_storage + 1373; } } @@ -39727,7 +42118,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd13", 11) == 0) { { -return dev_storage + 1230; +return dev_storage + 1358; } } @@ -39742,7 +42133,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc13", 11) == 0) { { -return dev_storage + 1215; +return dev_storage + 1343; } } @@ -39757,7 +42148,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb13", 11) == 0) { { -return dev_storage + 1200; +return dev_storage + 1328; } } @@ -39772,7 +42163,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba13", 11) == 0) { { -return dev_storage + 1185; +return dev_storage + 1313; } } @@ -39796,7 +42187,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz13", 11) == 0) { { -return dev_storage + 1144; +return dev_storage + 1272; } } @@ -39811,7 +42202,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday13", 11) == 0) { { -return dev_storage + 1129; +return dev_storage + 1257; } } @@ -39826,7 +42217,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax13", 11) == 0) { { -return dev_storage + 1114; +return dev_storage + 1242; } } @@ -39841,7 +42232,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw13", 11) == 0) { { -return dev_storage + 1099; +return dev_storage + 1227; } } @@ -39856,7 +42247,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav13", 11) == 0) { { -return dev_storage + 1084; +return dev_storage + 1212; } } @@ -39871,7 +42262,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau13", 11) == 0) { { -return dev_storage + 1069; +return dev_storage + 1197; } } @@ -39886,7 +42277,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat13", 11) == 0) { { -return dev_storage + 1054; +return dev_storage + 1182; } } @@ -39901,7 +42292,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas13", 11) == 0) { { -return dev_storage + 1039; +return dev_storage + 1167; } } @@ -39916,7 +42307,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar13", 11) == 0) { { -return dev_storage + 1024; +return dev_storage + 1152; } } @@ -39931,7 +42322,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq13", 11) == 0) { { -return dev_storage + 1009; +return dev_storage + 1137; } } @@ -39946,7 +42337,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap13", 11) == 0) { { -return dev_storage + 994; +return dev_storage + 1122; } } @@ -39961,7 +42352,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao13", 11) == 0) { { -return dev_storage + 979; +return dev_storage + 1107; } } @@ -39976,7 +42367,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan13", 11) == 0) { { -return dev_storage + 964; +return dev_storage + 1092; } } @@ -39991,7 +42382,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam13", 11) == 0) { { -return dev_storage + 949; +return dev_storage + 1077; } } @@ -40006,7 +42397,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal13", 11) == 0) { { -return dev_storage + 934; +return dev_storage + 1062; } } @@ -40021,7 +42412,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak13", 11) == 0) { { -return dev_storage + 919; +return dev_storage + 1047; } } @@ -40036,7 +42427,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj13", 11) == 0) { { -return dev_storage + 904; +return dev_storage + 1032; } } @@ -40051,7 +42442,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai13", 11) == 0) { { -return dev_storage + 889; +return dev_storage + 1017; } } @@ -40066,7 +42457,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah13", 11) == 0) { { -return dev_storage + 874; +return dev_storage + 1002; } } @@ -40081,7 +42472,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag13", 11) == 0) { { -return dev_storage + 859; +return dev_storage + 987; } } @@ -40096,7 +42487,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf13", 11) == 0) { { -return dev_storage + 844; +return dev_storage + 972; } } @@ -40111,7 +42502,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae13", 11) == 0) { { -return dev_storage + 829; +return dev_storage + 957; } } @@ -40126,7 +42517,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad13", 11) == 0) { { -return dev_storage + 814; +return dev_storage + 942; } } @@ -40141,7 +42532,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac13", 11) == 0) { { -return dev_storage + 799; +return dev_storage + 927; } } @@ -40156,7 +42547,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab13", 11) == 0) { { -return dev_storage + 784; +return dev_storage + 912; } } @@ -40171,7 +42562,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa13", 11) == 0) { { -return dev_storage + 769; +return dev_storage + 897; } } @@ -40204,7 +42595,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS62", 11) == 0) { { -return dev_storage + 2570; +return dev_storage + 2698; } } @@ -40219,7 +42610,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS52", 11) == 0) { { -return dev_storage + 2560; +return dev_storage + 2688; } } @@ -40234,7 +42625,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS42", 11) == 0) { { -return dev_storage + 2550; +return dev_storage + 2678; } } @@ -40249,7 +42640,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS32", 11) == 0) { { -return dev_storage + 2540; +return dev_storage + 2668; } } @@ -40261,25 +42652,88 @@ return NULL; } } case '2': - if (strncmp (KR_keyword, "/dev/ttyS22", 11) == 0) + switch (KR_keyword [5]) { + case 't': + if (strncmp (KR_keyword, "/dev/ttyS22", 11) == 0) + { { -return dev_storage + 2530; +return dev_storage + 2658; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty122", 11) == 0) + { +{ +return dev_storage + 420; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '1': - if (strncmp (KR_keyword, "/dev/ttyS12", 11) == 0) + switch (KR_keyword [5]) + { + case 't': + if (strncmp (KR_keyword, "/dev/ttyS12", 11) == 0) + { +{ +return dev_storage + 2648; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty112", 11) == 0) + { +{ +return dev_storage + 410; + +} + } + else + { +{ +return NULL; + +} + } + default: +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, "/dev/pty102", 11) == 0) { { -return dev_storage + 2520; +return dev_storage + 400; } } @@ -40303,7 +42757,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst122", 11) == 0) { { -return dev_storage + 226; +return dev_storage + 290; } } @@ -40318,7 +42772,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst112", 11) == 0) { { -return dev_storage + 216; +return dev_storage + 280; } } @@ -40333,7 +42787,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst102", 11) == 0) { { -return dev_storage + 206; +return dev_storage + 270; } } @@ -40353,6 +42807,51 @@ return NULL; case 'n': switch (KR_keyword [9]) { + case '9': + if (strncmp (KR_keyword, "/dev/cons92", 11) == 0) + { +{ +return dev_storage + 112; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/cons82", 11) == 0) + { +{ +return dev_storage + 102; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/cons72", 11) == 0) + { +{ +return dev_storage + 92; + +} + } + else + { +{ +return NULL; + +} + } case '6': if (strncmp (KR_keyword, "/dev/cons62", 11) == 0) { @@ -40456,7 +42955,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx12", 11) == 0) { { -return dev_storage + 2359; +return dev_storage + 2487; } } @@ -40471,7 +42970,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw12", 11) == 0) { { -return dev_storage + 2344; +return dev_storage + 2472; } } @@ -40486,7 +42985,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv12", 11) == 0) { { -return dev_storage + 2329; +return dev_storage + 2457; } } @@ -40501,7 +43000,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu12", 11) == 0) { { -return dev_storage + 2314; +return dev_storage + 2442; } } @@ -40516,7 +43015,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt12", 11) == 0) { { -return dev_storage + 2299; +return dev_storage + 2427; } } @@ -40531,7 +43030,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds12", 11) == 0) { { -return dev_storage + 2284; +return dev_storage + 2412; } } @@ -40546,7 +43045,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr12", 11) == 0) { { -return dev_storage + 2269; +return dev_storage + 2397; } } @@ -40561,7 +43060,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq12", 11) == 0) { { -return dev_storage + 2254; +return dev_storage + 2382; } } @@ -40576,7 +43075,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp12", 11) == 0) { { -return dev_storage + 2239; +return dev_storage + 2367; } } @@ -40591,7 +43090,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo12", 11) == 0) { { -return dev_storage + 2224; +return dev_storage + 2352; } } @@ -40606,7 +43105,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn12", 11) == 0) { { -return dev_storage + 2209; +return dev_storage + 2337; } } @@ -40621,7 +43120,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm12", 11) == 0) { { -return dev_storage + 2194; +return dev_storage + 2322; } } @@ -40636,7 +43135,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl12", 11) == 0) { { -return dev_storage + 2179; +return dev_storage + 2307; } } @@ -40651,7 +43150,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk12", 11) == 0) { { -return dev_storage + 2164; +return dev_storage + 2292; } } @@ -40666,7 +43165,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj12", 11) == 0) { { -return dev_storage + 2149; +return dev_storage + 2277; } } @@ -40681,7 +43180,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi12", 11) == 0) { { -return dev_storage + 2134; +return dev_storage + 2262; } } @@ -40696,7 +43195,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh12", 11) == 0) { { -return dev_storage + 2119; +return dev_storage + 2247; } } @@ -40711,7 +43210,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg12", 11) == 0) { { -return dev_storage + 2104; +return dev_storage + 2232; } } @@ -40726,7 +43225,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf12", 11) == 0) { { -return dev_storage + 2089; +return dev_storage + 2217; } } @@ -40741,7 +43240,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde12", 11) == 0) { { -return dev_storage + 2074; +return dev_storage + 2202; } } @@ -40756,7 +43255,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd12", 11) == 0) { { -return dev_storage + 2059; +return dev_storage + 2187; } } @@ -40771,7 +43270,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc12", 11) == 0) { { -return dev_storage + 2044; +return dev_storage + 2172; } } @@ -40786,7 +43285,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb12", 11) == 0) { { -return dev_storage + 2029; +return dev_storage + 2157; } } @@ -40801,7 +43300,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda12", 11) == 0) { { -return dev_storage + 2014; +return dev_storage + 2142; } } @@ -40825,7 +43324,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz12", 11) == 0) { { -return dev_storage + 1975; +return dev_storage + 2103; } } @@ -40840,7 +43339,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy12", 11) == 0) { { -return dev_storage + 1960; +return dev_storage + 2088; } } @@ -40855,7 +43354,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx12", 11) == 0) { { -return dev_storage + 1945; +return dev_storage + 2073; } } @@ -40870,7 +43369,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw12", 11) == 0) { { -return dev_storage + 1930; +return dev_storage + 2058; } } @@ -40885,7 +43384,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv12", 11) == 0) { { -return dev_storage + 1915; +return dev_storage + 2043; } } @@ -40900,7 +43399,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu12", 11) == 0) { { -return dev_storage + 1900; +return dev_storage + 2028; } } @@ -40915,7 +43414,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct12", 11) == 0) { { -return dev_storage + 1885; +return dev_storage + 2013; } } @@ -40930,7 +43429,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs12", 11) == 0) { { -return dev_storage + 1870; +return dev_storage + 1998; } } @@ -40945,7 +43444,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr12", 11) == 0) { { -return dev_storage + 1855; +return dev_storage + 1983; } } @@ -40960,7 +43459,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq12", 11) == 0) { { -return dev_storage + 1840; +return dev_storage + 1968; } } @@ -40975,7 +43474,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp12", 11) == 0) { { -return dev_storage + 1825; +return dev_storage + 1953; } } @@ -40990,7 +43489,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco12", 11) == 0) { { -return dev_storage + 1810; +return dev_storage + 1938; } } @@ -41005,7 +43504,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn12", 11) == 0) { { -return dev_storage + 1795; +return dev_storage + 1923; } } @@ -41020,7 +43519,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm12", 11) == 0) { { -return dev_storage + 1780; +return dev_storage + 1908; } } @@ -41035,7 +43534,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl12", 11) == 0) { { -return dev_storage + 1765; +return dev_storage + 1893; } } @@ -41050,7 +43549,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck12", 11) == 0) { { -return dev_storage + 1750; +return dev_storage + 1878; } } @@ -41065,7 +43564,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj12", 11) == 0) { { -return dev_storage + 1735; +return dev_storage + 1863; } } @@ -41080,7 +43579,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci12", 11) == 0) { { -return dev_storage + 1720; +return dev_storage + 1848; } } @@ -41095,7 +43594,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch12", 11) == 0) { { -return dev_storage + 1705; +return dev_storage + 1833; } } @@ -41110,7 +43609,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg12", 11) == 0) { { -return dev_storage + 1690; +return dev_storage + 1818; } } @@ -41125,7 +43624,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf12", 11) == 0) { { -return dev_storage + 1675; +return dev_storage + 1803; } } @@ -41140,7 +43639,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce12", 11) == 0) { { -return dev_storage + 1660; +return dev_storage + 1788; } } @@ -41155,7 +43654,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd12", 11) == 0) { { -return dev_storage + 1645; +return dev_storage + 1773; } } @@ -41170,7 +43669,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc12", 11) == 0) { { -return dev_storage + 1630; +return dev_storage + 1758; } } @@ -41185,7 +43684,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb12", 11) == 0) { { -return dev_storage + 1615; +return dev_storage + 1743; } } @@ -41200,7 +43699,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca12", 11) == 0) { { -return dev_storage + 1600; +return dev_storage + 1728; } } @@ -41224,7 +43723,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz12", 11) == 0) { { -return dev_storage + 1559; +return dev_storage + 1687; } } @@ -41239,7 +43738,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby12", 11) == 0) { { -return dev_storage + 1544; +return dev_storage + 1672; } } @@ -41254,7 +43753,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx12", 11) == 0) { { -return dev_storage + 1529; +return dev_storage + 1657; } } @@ -41269,7 +43768,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw12", 11) == 0) { { -return dev_storage + 1514; +return dev_storage + 1642; } } @@ -41284,7 +43783,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv12", 11) == 0) { { -return dev_storage + 1499; +return dev_storage + 1627; } } @@ -41299,7 +43798,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu12", 11) == 0) { { -return dev_storage + 1484; +return dev_storage + 1612; } } @@ -41314,7 +43813,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt12", 11) == 0) { { -return dev_storage + 1469; +return dev_storage + 1597; } } @@ -41329,7 +43828,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs12", 11) == 0) { { -return dev_storage + 1454; +return dev_storage + 1582; } } @@ -41344,7 +43843,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr12", 11) == 0) { { -return dev_storage + 1439; +return dev_storage + 1567; } } @@ -41359,7 +43858,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq12", 11) == 0) { { -return dev_storage + 1424; +return dev_storage + 1552; } } @@ -41374,7 +43873,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp12", 11) == 0) { { -return dev_storage + 1409; +return dev_storage + 1537; } } @@ -41389,7 +43888,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo12", 11) == 0) { { -return dev_storage + 1394; +return dev_storage + 1522; } } @@ -41404,7 +43903,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn12", 11) == 0) { { -return dev_storage + 1379; +return dev_storage + 1507; } } @@ -41419,7 +43918,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm12", 11) == 0) { { -return dev_storage + 1364; +return dev_storage + 1492; } } @@ -41434,7 +43933,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl12", 11) == 0) { { -return dev_storage + 1349; +return dev_storage + 1477; } } @@ -41449,7 +43948,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk12", 11) == 0) { { -return dev_storage + 1334; +return dev_storage + 1462; } } @@ -41464,7 +43963,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj12", 11) == 0) { { -return dev_storage + 1319; +return dev_storage + 1447; } } @@ -41479,7 +43978,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi12", 11) == 0) { { -return dev_storage + 1304; +return dev_storage + 1432; } } @@ -41494,7 +43993,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh12", 11) == 0) { { -return dev_storage + 1289; +return dev_storage + 1417; } } @@ -41509,7 +44008,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg12", 11) == 0) { { -return dev_storage + 1274; +return dev_storage + 1402; } } @@ -41524,7 +44023,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf12", 11) == 0) { { -return dev_storage + 1259; +return dev_storage + 1387; } } @@ -41539,7 +44038,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe12", 11) == 0) { { -return dev_storage + 1244; +return dev_storage + 1372; } } @@ -41554,7 +44053,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd12", 11) == 0) { { -return dev_storage + 1229; +return dev_storage + 1357; } } @@ -41569,7 +44068,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc12", 11) == 0) { { -return dev_storage + 1214; +return dev_storage + 1342; } } @@ -41584,7 +44083,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb12", 11) == 0) { { -return dev_storage + 1199; +return dev_storage + 1327; } } @@ -41599,7 +44098,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba12", 11) == 0) { { -return dev_storage + 1184; +return dev_storage + 1312; } } @@ -41623,7 +44122,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz12", 11) == 0) { { -return dev_storage + 1143; +return dev_storage + 1271; } } @@ -41638,7 +44137,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday12", 11) == 0) { { -return dev_storage + 1128; +return dev_storage + 1256; } } @@ -41653,7 +44152,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax12", 11) == 0) { { -return dev_storage + 1113; +return dev_storage + 1241; } } @@ -41668,7 +44167,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw12", 11) == 0) { { -return dev_storage + 1098; +return dev_storage + 1226; } } @@ -41683,7 +44182,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav12", 11) == 0) { { -return dev_storage + 1083; +return dev_storage + 1211; } } @@ -41698,7 +44197,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau12", 11) == 0) { { -return dev_storage + 1068; +return dev_storage + 1196; } } @@ -41713,7 +44212,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat12", 11) == 0) { { -return dev_storage + 1053; +return dev_storage + 1181; } } @@ -41728,7 +44227,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas12", 11) == 0) { { -return dev_storage + 1038; +return dev_storage + 1166; } } @@ -41743,7 +44242,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar12", 11) == 0) { { -return dev_storage + 1023; +return dev_storage + 1151; } } @@ -41758,7 +44257,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq12", 11) == 0) { { -return dev_storage + 1008; +return dev_storage + 1136; } } @@ -41773,7 +44272,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap12", 11) == 0) { { -return dev_storage + 993; +return dev_storage + 1121; } } @@ -41788,7 +44287,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao12", 11) == 0) { { -return dev_storage + 978; +return dev_storage + 1106; } } @@ -41803,7 +44302,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan12", 11) == 0) { { -return dev_storage + 963; +return dev_storage + 1091; } } @@ -41818,7 +44317,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam12", 11) == 0) { { -return dev_storage + 948; +return dev_storage + 1076; } } @@ -41833,7 +44332,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal12", 11) == 0) { { -return dev_storage + 933; +return dev_storage + 1061; } } @@ -41848,7 +44347,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak12", 11) == 0) { { -return dev_storage + 918; +return dev_storage + 1046; } } @@ -41863,7 +44362,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj12", 11) == 0) { { -return dev_storage + 903; +return dev_storage + 1031; } } @@ -41878,7 +44377,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai12", 11) == 0) { { -return dev_storage + 888; +return dev_storage + 1016; } } @@ -41893,7 +44392,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah12", 11) == 0) { { -return dev_storage + 873; +return dev_storage + 1001; } } @@ -41908,7 +44407,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag12", 11) == 0) { { -return dev_storage + 858; +return dev_storage + 986; } } @@ -41923,7 +44422,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf12", 11) == 0) { { -return dev_storage + 843; +return dev_storage + 971; } } @@ -41938,7 +44437,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae12", 11) == 0) { { -return dev_storage + 828; +return dev_storage + 956; } } @@ -41953,7 +44452,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad12", 11) == 0) { { -return dev_storage + 813; +return dev_storage + 941; } } @@ -41968,7 +44467,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac12", 11) == 0) { { -return dev_storage + 798; +return dev_storage + 926; } } @@ -41983,7 +44482,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab12", 11) == 0) { { -return dev_storage + 783; +return dev_storage + 911; } } @@ -41998,7 +44497,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa12", 11) == 0) { { -return dev_storage + 768; +return dev_storage + 896; } } @@ -42031,7 +44530,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS61", 11) == 0) { { -return dev_storage + 2569; +return dev_storage + 2697; } } @@ -42046,7 +44545,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS51", 11) == 0) { { -return dev_storage + 2559; +return dev_storage + 2687; } } @@ -42061,7 +44560,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS41", 11) == 0) { { -return dev_storage + 2549; +return dev_storage + 2677; } } @@ -42076,7 +44575,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS31", 11) == 0) { { -return dev_storage + 2539; +return dev_storage + 2667; } } @@ -42088,25 +44587,88 @@ return NULL; } } case '2': - if (strncmp (KR_keyword, "/dev/ttyS21", 11) == 0) + switch (KR_keyword [5]) { + case 't': + if (strncmp (KR_keyword, "/dev/ttyS21", 11) == 0) + { { -return dev_storage + 2529; +return dev_storage + 2657; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty121", 11) == 0) + { +{ +return dev_storage + 419; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '1': - if (strncmp (KR_keyword, "/dev/ttyS11", 11) == 0) + switch (KR_keyword [5]) + { + case 't': + if (strncmp (KR_keyword, "/dev/ttyS11", 11) == 0) + { +{ +return dev_storage + 2647; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty111", 11) == 0) + { +{ +return dev_storage + 409; + +} + } + else + { +{ +return NULL; + +} + } + default: +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, "/dev/pty101", 11) == 0) { { -return dev_storage + 2519; +return dev_storage + 399; } } @@ -42130,7 +44692,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst121", 11) == 0) { { -return dev_storage + 225; +return dev_storage + 289; } } @@ -42145,7 +44707,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst111", 11) == 0) { { -return dev_storage + 215; +return dev_storage + 279; } } @@ -42160,7 +44722,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst101", 11) == 0) { { -return dev_storage + 205; +return dev_storage + 269; } } @@ -42180,6 +44742,51 @@ return NULL; case 'n': switch (KR_keyword [9]) { + case '9': + if (strncmp (KR_keyword, "/dev/cons91", 11) == 0) + { +{ +return dev_storage + 111; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/cons81", 11) == 0) + { +{ +return dev_storage + 101; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/cons71", 11) == 0) + { +{ +return dev_storage + 91; + +} + } + else + { +{ +return NULL; + +} + } case '6': if (strncmp (KR_keyword, "/dev/cons61", 11) == 0) { @@ -42283,7 +44890,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx11", 11) == 0) { { -return dev_storage + 2358; +return dev_storage + 2486; } } @@ -42298,7 +44905,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw11", 11) == 0) { { -return dev_storage + 2343; +return dev_storage + 2471; } } @@ -42313,7 +44920,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv11", 11) == 0) { { -return dev_storage + 2328; +return dev_storage + 2456; } } @@ -42328,7 +44935,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu11", 11) == 0) { { -return dev_storage + 2313; +return dev_storage + 2441; } } @@ -42343,7 +44950,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt11", 11) == 0) { { -return dev_storage + 2298; +return dev_storage + 2426; } } @@ -42358,7 +44965,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds11", 11) == 0) { { -return dev_storage + 2283; +return dev_storage + 2411; } } @@ -42373,7 +44980,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr11", 11) == 0) { { -return dev_storage + 2268; +return dev_storage + 2396; } } @@ -42388,7 +44995,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq11", 11) == 0) { { -return dev_storage + 2253; +return dev_storage + 2381; } } @@ -42403,7 +45010,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp11", 11) == 0) { { -return dev_storage + 2238; +return dev_storage + 2366; } } @@ -42418,7 +45025,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo11", 11) == 0) { { -return dev_storage + 2223; +return dev_storage + 2351; } } @@ -42433,7 +45040,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn11", 11) == 0) { { -return dev_storage + 2208; +return dev_storage + 2336; } } @@ -42448,7 +45055,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm11", 11) == 0) { { -return dev_storage + 2193; +return dev_storage + 2321; } } @@ -42463,7 +45070,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl11", 11) == 0) { { -return dev_storage + 2178; +return dev_storage + 2306; } } @@ -42478,7 +45085,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk11", 11) == 0) { { -return dev_storage + 2163; +return dev_storage + 2291; } } @@ -42493,7 +45100,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj11", 11) == 0) { { -return dev_storage + 2148; +return dev_storage + 2276; } } @@ -42508,7 +45115,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi11", 11) == 0) { { -return dev_storage + 2133; +return dev_storage + 2261; } } @@ -42523,7 +45130,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh11", 11) == 0) { { -return dev_storage + 2118; +return dev_storage + 2246; } } @@ -42538,7 +45145,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg11", 11) == 0) { { -return dev_storage + 2103; +return dev_storage + 2231; } } @@ -42553,7 +45160,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf11", 11) == 0) { { -return dev_storage + 2088; +return dev_storage + 2216; } } @@ -42568,7 +45175,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde11", 11) == 0) { { -return dev_storage + 2073; +return dev_storage + 2201; } } @@ -42583,7 +45190,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd11", 11) == 0) { { -return dev_storage + 2058; +return dev_storage + 2186; } } @@ -42598,7 +45205,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc11", 11) == 0) { { -return dev_storage + 2043; +return dev_storage + 2171; } } @@ -42613,7 +45220,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb11", 11) == 0) { { -return dev_storage + 2028; +return dev_storage + 2156; } } @@ -42628,7 +45235,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda11", 11) == 0) { { -return dev_storage + 2013; +return dev_storage + 2141; } } @@ -42652,7 +45259,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz11", 11) == 0) { { -return dev_storage + 1974; +return dev_storage + 2102; } } @@ -42667,7 +45274,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy11", 11) == 0) { { -return dev_storage + 1959; +return dev_storage + 2087; } } @@ -42682,7 +45289,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx11", 11) == 0) { { -return dev_storage + 1944; +return dev_storage + 2072; } } @@ -42697,7 +45304,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw11", 11) == 0) { { -return dev_storage + 1929; +return dev_storage + 2057; } } @@ -42712,7 +45319,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv11", 11) == 0) { { -return dev_storage + 1914; +return dev_storage + 2042; } } @@ -42727,7 +45334,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu11", 11) == 0) { { -return dev_storage + 1899; +return dev_storage + 2027; } } @@ -42742,7 +45349,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct11", 11) == 0) { { -return dev_storage + 1884; +return dev_storage + 2012; } } @@ -42757,7 +45364,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs11", 11) == 0) { { -return dev_storage + 1869; +return dev_storage + 1997; } } @@ -42772,7 +45379,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr11", 11) == 0) { { -return dev_storage + 1854; +return dev_storage + 1982; } } @@ -42787,7 +45394,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq11", 11) == 0) { { -return dev_storage + 1839; +return dev_storage + 1967; } } @@ -42802,7 +45409,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp11", 11) == 0) { { -return dev_storage + 1824; +return dev_storage + 1952; } } @@ -42817,7 +45424,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco11", 11) == 0) { { -return dev_storage + 1809; +return dev_storage + 1937; } } @@ -42832,7 +45439,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn11", 11) == 0) { { -return dev_storage + 1794; +return dev_storage + 1922; } } @@ -42847,7 +45454,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm11", 11) == 0) { { -return dev_storage + 1779; +return dev_storage + 1907; } } @@ -42862,7 +45469,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl11", 11) == 0) { { -return dev_storage + 1764; +return dev_storage + 1892; } } @@ -42877,7 +45484,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck11", 11) == 0) { { -return dev_storage + 1749; +return dev_storage + 1877; } } @@ -42892,7 +45499,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj11", 11) == 0) { { -return dev_storage + 1734; +return dev_storage + 1862; } } @@ -42907,7 +45514,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci11", 11) == 0) { { -return dev_storage + 1719; +return dev_storage + 1847; } } @@ -42922,7 +45529,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch11", 11) == 0) { { -return dev_storage + 1704; +return dev_storage + 1832; } } @@ -42937,7 +45544,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg11", 11) == 0) { { -return dev_storage + 1689; +return dev_storage + 1817; } } @@ -42952,7 +45559,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf11", 11) == 0) { { -return dev_storage + 1674; +return dev_storage + 1802; } } @@ -42967,7 +45574,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce11", 11) == 0) { { -return dev_storage + 1659; +return dev_storage + 1787; } } @@ -42982,7 +45589,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd11", 11) == 0) { { -return dev_storage + 1644; +return dev_storage + 1772; } } @@ -42997,7 +45604,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc11", 11) == 0) { { -return dev_storage + 1629; +return dev_storage + 1757; } } @@ -43012,7 +45619,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb11", 11) == 0) { { -return dev_storage + 1614; +return dev_storage + 1742; } } @@ -43027,7 +45634,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca11", 11) == 0) { { -return dev_storage + 1599; +return dev_storage + 1727; } } @@ -43051,7 +45658,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz11", 11) == 0) { { -return dev_storage + 1558; +return dev_storage + 1686; } } @@ -43066,7 +45673,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby11", 11) == 0) { { -return dev_storage + 1543; +return dev_storage + 1671; } } @@ -43081,7 +45688,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx11", 11) == 0) { { -return dev_storage + 1528; +return dev_storage + 1656; } } @@ -43096,7 +45703,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw11", 11) == 0) { { -return dev_storage + 1513; +return dev_storage + 1641; } } @@ -43111,7 +45718,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv11", 11) == 0) { { -return dev_storage + 1498; +return dev_storage + 1626; } } @@ -43126,7 +45733,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu11", 11) == 0) { { -return dev_storage + 1483; +return dev_storage + 1611; } } @@ -43141,7 +45748,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt11", 11) == 0) { { -return dev_storage + 1468; +return dev_storage + 1596; } } @@ -43156,7 +45763,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs11", 11) == 0) { { -return dev_storage + 1453; +return dev_storage + 1581; } } @@ -43171,7 +45778,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr11", 11) == 0) { { -return dev_storage + 1438; +return dev_storage + 1566; } } @@ -43186,7 +45793,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq11", 11) == 0) { { -return dev_storage + 1423; +return dev_storage + 1551; } } @@ -43201,7 +45808,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp11", 11) == 0) { { -return dev_storage + 1408; +return dev_storage + 1536; } } @@ -43216,7 +45823,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo11", 11) == 0) { { -return dev_storage + 1393; +return dev_storage + 1521; } } @@ -43231,7 +45838,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn11", 11) == 0) { { -return dev_storage + 1378; +return dev_storage + 1506; } } @@ -43246,7 +45853,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm11", 11) == 0) { { -return dev_storage + 1363; +return dev_storage + 1491; } } @@ -43261,7 +45868,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl11", 11) == 0) { { -return dev_storage + 1348; +return dev_storage + 1476; } } @@ -43276,7 +45883,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk11", 11) == 0) { { -return dev_storage + 1333; +return dev_storage + 1461; } } @@ -43291,7 +45898,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj11", 11) == 0) { { -return dev_storage + 1318; +return dev_storage + 1446; } } @@ -43306,7 +45913,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi11", 11) == 0) { { -return dev_storage + 1303; +return dev_storage + 1431; } } @@ -43321,7 +45928,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh11", 11) == 0) { { -return dev_storage + 1288; +return dev_storage + 1416; } } @@ -43336,7 +45943,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg11", 11) == 0) { { -return dev_storage + 1273; +return dev_storage + 1401; } } @@ -43351,7 +45958,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf11", 11) == 0) { { -return dev_storage + 1258; +return dev_storage + 1386; } } @@ -43366,7 +45973,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe11", 11) == 0) { { -return dev_storage + 1243; +return dev_storage + 1371; } } @@ -43381,7 +45988,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd11", 11) == 0) { { -return dev_storage + 1228; +return dev_storage + 1356; } } @@ -43396,7 +46003,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc11", 11) == 0) { { -return dev_storage + 1213; +return dev_storage + 1341; } } @@ -43411,7 +46018,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb11", 11) == 0) { { -return dev_storage + 1198; +return dev_storage + 1326; } } @@ -43426,7 +46033,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba11", 11) == 0) { { -return dev_storage + 1183; +return dev_storage + 1311; } } @@ -43450,7 +46057,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz11", 11) == 0) { { -return dev_storage + 1142; +return dev_storage + 1270; } } @@ -43465,7 +46072,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday11", 11) == 0) { { -return dev_storage + 1127; +return dev_storage + 1255; } } @@ -43480,7 +46087,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax11", 11) == 0) { { -return dev_storage + 1112; +return dev_storage + 1240; } } @@ -43495,7 +46102,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw11", 11) == 0) { { -return dev_storage + 1097; +return dev_storage + 1225; } } @@ -43510,7 +46117,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav11", 11) == 0) { { -return dev_storage + 1082; +return dev_storage + 1210; } } @@ -43525,7 +46132,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau11", 11) == 0) { { -return dev_storage + 1067; +return dev_storage + 1195; } } @@ -43540,7 +46147,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat11", 11) == 0) { { -return dev_storage + 1052; +return dev_storage + 1180; } } @@ -43555,7 +46162,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas11", 11) == 0) { { -return dev_storage + 1037; +return dev_storage + 1165; } } @@ -43570,7 +46177,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar11", 11) == 0) { { -return dev_storage + 1022; +return dev_storage + 1150; } } @@ -43585,7 +46192,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq11", 11) == 0) { { -return dev_storage + 1007; +return dev_storage + 1135; } } @@ -43600,7 +46207,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap11", 11) == 0) { { -return dev_storage + 992; +return dev_storage + 1120; } } @@ -43615,7 +46222,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao11", 11) == 0) { { -return dev_storage + 977; +return dev_storage + 1105; } } @@ -43630,7 +46237,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan11", 11) == 0) { { -return dev_storage + 962; +return dev_storage + 1090; } } @@ -43645,7 +46252,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam11", 11) == 0) { { -return dev_storage + 947; +return dev_storage + 1075; } } @@ -43660,7 +46267,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal11", 11) == 0) { { -return dev_storage + 932; +return dev_storage + 1060; } } @@ -43675,7 +46282,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak11", 11) == 0) { { -return dev_storage + 917; +return dev_storage + 1045; } } @@ -43690,7 +46297,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj11", 11) == 0) { { -return dev_storage + 902; +return dev_storage + 1030; } } @@ -43705,7 +46312,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai11", 11) == 0) { { -return dev_storage + 887; +return dev_storage + 1015; } } @@ -43720,7 +46327,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah11", 11) == 0) { { -return dev_storage + 872; +return dev_storage + 1000; } } @@ -43735,7 +46342,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag11", 11) == 0) { { -return dev_storage + 857; +return dev_storage + 985; } } @@ -43750,7 +46357,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf11", 11) == 0) { { -return dev_storage + 842; +return dev_storage + 970; } } @@ -43765,7 +46372,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae11", 11) == 0) { { -return dev_storage + 827; +return dev_storage + 955; } } @@ -43780,7 +46387,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad11", 11) == 0) { { -return dev_storage + 812; +return dev_storage + 940; } } @@ -43795,7 +46402,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac11", 11) == 0) { { -return dev_storage + 797; +return dev_storage + 925; } } @@ -43810,7 +46417,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab11", 11) == 0) { { -return dev_storage + 782; +return dev_storage + 910; } } @@ -43825,7 +46432,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa11", 11) == 0) { { -return dev_storage + 767; +return dev_storage + 895; } } @@ -43858,7 +46465,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS60", 11) == 0) { { -return dev_storage + 2568; +return dev_storage + 2696; } } @@ -43873,7 +46480,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS50", 11) == 0) { { -return dev_storage + 2558; +return dev_storage + 2686; } } @@ -43888,7 +46495,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS40", 11) == 0) { { -return dev_storage + 2548; +return dev_storage + 2676; } } @@ -43903,7 +46510,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/ttyS30", 11) == 0) { { -return dev_storage + 2538; +return dev_storage + 2666; } } @@ -43915,25 +46522,88 @@ return NULL; } } case '2': - if (strncmp (KR_keyword, "/dev/ttyS20", 11) == 0) + switch (KR_keyword [5]) { + case 't': + if (strncmp (KR_keyword, "/dev/ttyS20", 11) == 0) + { { -return dev_storage + 2528; +return dev_storage + 2656; } - } - else - { + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty120", 11) == 0) + { +{ +return dev_storage + 418; + +} + } + else + { +{ +return NULL; + +} + } + default: { return NULL; } } case '1': - if (strncmp (KR_keyword, "/dev/ttyS10", 11) == 0) + switch (KR_keyword [5]) + { + case 't': + if (strncmp (KR_keyword, "/dev/ttyS10", 11) == 0) + { +{ +return dev_storage + 2646; + +} + } + else + { +{ +return NULL; + +} + } + case 'p': + if (strncmp (KR_keyword, "/dev/pty110", 11) == 0) + { +{ +return dev_storage + 408; + +} + } + else + { +{ +return NULL; + +} + } + default: +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, "/dev/pty100", 11) == 0) { { -return dev_storage + 2518; +return dev_storage + 398; } } @@ -43957,7 +46627,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst120", 11) == 0) { { -return dev_storage + 224; +return dev_storage + 288; } } @@ -43972,7 +46642,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst110", 11) == 0) { { -return dev_storage + 214; +return dev_storage + 278; } } @@ -43987,7 +46657,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/nst100", 11) == 0) { { -return dev_storage + 204; +return dev_storage + 268; } } @@ -44007,6 +46677,51 @@ return NULL; case 'n': switch (KR_keyword [9]) { + case '9': + if (strncmp (KR_keyword, "/dev/cons90", 11) == 0) + { +{ +return dev_storage + 110; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/cons80", 11) == 0) + { +{ +return dev_storage + 100; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/cons70", 11) == 0) + { +{ +return dev_storage + 90; + +} + } + else + { +{ +return NULL; + +} + } case '6': if (strncmp (KR_keyword, "/dev/cons60", 11) == 0) { @@ -44110,7 +46825,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddx10", 11) == 0) { { -return dev_storage + 2357; +return dev_storage + 2485; } } @@ -44125,7 +46840,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddw10", 11) == 0) { { -return dev_storage + 2342; +return dev_storage + 2470; } } @@ -44140,7 +46855,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddv10", 11) == 0) { { -return dev_storage + 2327; +return dev_storage + 2455; } } @@ -44155,7 +46870,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddu10", 11) == 0) { { -return dev_storage + 2312; +return dev_storage + 2440; } } @@ -44170,7 +46885,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddt10", 11) == 0) { { -return dev_storage + 2297; +return dev_storage + 2425; } } @@ -44185,7 +46900,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdds10", 11) == 0) { { -return dev_storage + 2282; +return dev_storage + 2410; } } @@ -44200,7 +46915,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddr10", 11) == 0) { { -return dev_storage + 2267; +return dev_storage + 2395; } } @@ -44215,7 +46930,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddq10", 11) == 0) { { -return dev_storage + 2252; +return dev_storage + 2380; } } @@ -44230,7 +46945,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddp10", 11) == 0) { { -return dev_storage + 2237; +return dev_storage + 2365; } } @@ -44245,7 +46960,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddo10", 11) == 0) { { -return dev_storage + 2222; +return dev_storage + 2350; } } @@ -44260,7 +46975,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddn10", 11) == 0) { { -return dev_storage + 2207; +return dev_storage + 2335; } } @@ -44275,7 +46990,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddm10", 11) == 0) { { -return dev_storage + 2192; +return dev_storage + 2320; } } @@ -44290,7 +47005,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddl10", 11) == 0) { { -return dev_storage + 2177; +return dev_storage + 2305; } } @@ -44305,7 +47020,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddk10", 11) == 0) { { -return dev_storage + 2162; +return dev_storage + 2290; } } @@ -44320,7 +47035,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddj10", 11) == 0) { { -return dev_storage + 2147; +return dev_storage + 2275; } } @@ -44335,7 +47050,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddi10", 11) == 0) { { -return dev_storage + 2132; +return dev_storage + 2260; } } @@ -44350,7 +47065,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddh10", 11) == 0) { { -return dev_storage + 2117; +return dev_storage + 2245; } } @@ -44365,7 +47080,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddg10", 11) == 0) { { -return dev_storage + 2102; +return dev_storage + 2230; } } @@ -44380,7 +47095,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddf10", 11) == 0) { { -return dev_storage + 2087; +return dev_storage + 2215; } } @@ -44395,7 +47110,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdde10", 11) == 0) { { -return dev_storage + 2072; +return dev_storage + 2200; } } @@ -44410,7 +47125,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddd10", 11) == 0) { { -return dev_storage + 2057; +return dev_storage + 2185; } } @@ -44425,7 +47140,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddc10", 11) == 0) { { -return dev_storage + 2042; +return dev_storage + 2170; } } @@ -44440,7 +47155,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sddb10", 11) == 0) { { -return dev_storage + 2027; +return dev_storage + 2155; } } @@ -44455,7 +47170,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdda10", 11) == 0) { { -return dev_storage + 2012; +return dev_storage + 2140; } } @@ -44479,7 +47194,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcz10", 11) == 0) { { -return dev_storage + 1973; +return dev_storage + 2101; } } @@ -44494,7 +47209,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcy10", 11) == 0) { { -return dev_storage + 1958; +return dev_storage + 2086; } } @@ -44509,7 +47224,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcx10", 11) == 0) { { -return dev_storage + 1943; +return dev_storage + 2071; } } @@ -44524,7 +47239,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcw10", 11) == 0) { { -return dev_storage + 1928; +return dev_storage + 2056; } } @@ -44539,7 +47254,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcv10", 11) == 0) { { -return dev_storage + 1913; +return dev_storage + 2041; } } @@ -44554,7 +47269,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcu10", 11) == 0) { { -return dev_storage + 1898; +return dev_storage + 2026; } } @@ -44569,7 +47284,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdct10", 11) == 0) { { -return dev_storage + 1883; +return dev_storage + 2011; } } @@ -44584,7 +47299,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcs10", 11) == 0) { { -return dev_storage + 1868; +return dev_storage + 1996; } } @@ -44599,7 +47314,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcr10", 11) == 0) { { -return dev_storage + 1853; +return dev_storage + 1981; } } @@ -44614,7 +47329,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcq10", 11) == 0) { { -return dev_storage + 1838; +return dev_storage + 1966; } } @@ -44629,7 +47344,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcp10", 11) == 0) { { -return dev_storage + 1823; +return dev_storage + 1951; } } @@ -44644,7 +47359,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdco10", 11) == 0) { { -return dev_storage + 1808; +return dev_storage + 1936; } } @@ -44659,7 +47374,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcn10", 11) == 0) { { -return dev_storage + 1793; +return dev_storage + 1921; } } @@ -44674,7 +47389,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcm10", 11) == 0) { { -return dev_storage + 1778; +return dev_storage + 1906; } } @@ -44689,7 +47404,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcl10", 11) == 0) { { -return dev_storage + 1763; +return dev_storage + 1891; } } @@ -44704,7 +47419,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdck10", 11) == 0) { { -return dev_storage + 1748; +return dev_storage + 1876; } } @@ -44719,7 +47434,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcj10", 11) == 0) { { -return dev_storage + 1733; +return dev_storage + 1861; } } @@ -44734,7 +47449,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdci10", 11) == 0) { { -return dev_storage + 1718; +return dev_storage + 1846; } } @@ -44749,7 +47464,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdch10", 11) == 0) { { -return dev_storage + 1703; +return dev_storage + 1831; } } @@ -44764,7 +47479,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcg10", 11) == 0) { { -return dev_storage + 1688; +return dev_storage + 1816; } } @@ -44779,7 +47494,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcf10", 11) == 0) { { -return dev_storage + 1673; +return dev_storage + 1801; } } @@ -44794,7 +47509,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdce10", 11) == 0) { { -return dev_storage + 1658; +return dev_storage + 1786; } } @@ -44809,7 +47524,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcd10", 11) == 0) { { -return dev_storage + 1643; +return dev_storage + 1771; } } @@ -44824,7 +47539,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcc10", 11) == 0) { { -return dev_storage + 1628; +return dev_storage + 1756; } } @@ -44839,7 +47554,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdcb10", 11) == 0) { { -return dev_storage + 1613; +return dev_storage + 1741; } } @@ -44854,7 +47569,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdca10", 11) == 0) { { -return dev_storage + 1598; +return dev_storage + 1726; } } @@ -44878,7 +47593,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbz10", 11) == 0) { { -return dev_storage + 1557; +return dev_storage + 1685; } } @@ -44893,7 +47608,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdby10", 11) == 0) { { -return dev_storage + 1542; +return dev_storage + 1670; } } @@ -44908,7 +47623,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbx10", 11) == 0) { { -return dev_storage + 1527; +return dev_storage + 1655; } } @@ -44923,7 +47638,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbw10", 11) == 0) { { -return dev_storage + 1512; +return dev_storage + 1640; } } @@ -44938,7 +47653,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbv10", 11) == 0) { { -return dev_storage + 1497; +return dev_storage + 1625; } } @@ -44953,7 +47668,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbu10", 11) == 0) { { -return dev_storage + 1482; +return dev_storage + 1610; } } @@ -44968,7 +47683,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbt10", 11) == 0) { { -return dev_storage + 1467; +return dev_storage + 1595; } } @@ -44983,7 +47698,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbs10", 11) == 0) { { -return dev_storage + 1452; +return dev_storage + 1580; } } @@ -44998,7 +47713,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbr10", 11) == 0) { { -return dev_storage + 1437; +return dev_storage + 1565; } } @@ -45013,7 +47728,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbq10", 11) == 0) { { -return dev_storage + 1422; +return dev_storage + 1550; } } @@ -45028,7 +47743,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbp10", 11) == 0) { { -return dev_storage + 1407; +return dev_storage + 1535; } } @@ -45043,7 +47758,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbo10", 11) == 0) { { -return dev_storage + 1392; +return dev_storage + 1520; } } @@ -45058,7 +47773,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbn10", 11) == 0) { { -return dev_storage + 1377; +return dev_storage + 1505; } } @@ -45073,7 +47788,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbm10", 11) == 0) { { -return dev_storage + 1362; +return dev_storage + 1490; } } @@ -45088,7 +47803,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbl10", 11) == 0) { { -return dev_storage + 1347; +return dev_storage + 1475; } } @@ -45103,7 +47818,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbk10", 11) == 0) { { -return dev_storage + 1332; +return dev_storage + 1460; } } @@ -45118,7 +47833,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbj10", 11) == 0) { { -return dev_storage + 1317; +return dev_storage + 1445; } } @@ -45133,7 +47848,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbi10", 11) == 0) { { -return dev_storage + 1302; +return dev_storage + 1430; } } @@ -45148,7 +47863,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbh10", 11) == 0) { { -return dev_storage + 1287; +return dev_storage + 1415; } } @@ -45163,7 +47878,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbg10", 11) == 0) { { -return dev_storage + 1272; +return dev_storage + 1400; } } @@ -45178,7 +47893,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbf10", 11) == 0) { { -return dev_storage + 1257; +return dev_storage + 1385; } } @@ -45193,7 +47908,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbe10", 11) == 0) { { -return dev_storage + 1242; +return dev_storage + 1370; } } @@ -45208,7 +47923,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbd10", 11) == 0) { { -return dev_storage + 1227; +return dev_storage + 1355; } } @@ -45223,7 +47938,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbc10", 11) == 0) { { -return dev_storage + 1212; +return dev_storage + 1340; } } @@ -45238,7 +47953,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdbb10", 11) == 0) { { -return dev_storage + 1197; +return dev_storage + 1325; } } @@ -45253,7 +47968,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdba10", 11) == 0) { { -return dev_storage + 1182; +return dev_storage + 1310; } } @@ -45277,7 +47992,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaz10", 11) == 0) { { -return dev_storage + 1141; +return dev_storage + 1269; } } @@ -45292,7 +48007,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sday10", 11) == 0) { { -return dev_storage + 1126; +return dev_storage + 1254; } } @@ -45307,7 +48022,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdax10", 11) == 0) { { -return dev_storage + 1111; +return dev_storage + 1239; } } @@ -45322,7 +48037,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaw10", 11) == 0) { { -return dev_storage + 1096; +return dev_storage + 1224; } } @@ -45337,7 +48052,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdav10", 11) == 0) { { -return dev_storage + 1081; +return dev_storage + 1209; } } @@ -45352,7 +48067,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdau10", 11) == 0) { { -return dev_storage + 1066; +return dev_storage + 1194; } } @@ -45367,7 +48082,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdat10", 11) == 0) { { -return dev_storage + 1051; +return dev_storage + 1179; } } @@ -45382,7 +48097,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdas10", 11) == 0) { { -return dev_storage + 1036; +return dev_storage + 1164; } } @@ -45397,7 +48112,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdar10", 11) == 0) { { -return dev_storage + 1021; +return dev_storage + 1149; } } @@ -45412,7 +48127,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaq10", 11) == 0) { { -return dev_storage + 1006; +return dev_storage + 1134; } } @@ -45427,7 +48142,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdap10", 11) == 0) { { -return dev_storage + 991; +return dev_storage + 1119; } } @@ -45442,7 +48157,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdao10", 11) == 0) { { -return dev_storage + 976; +return dev_storage + 1104; } } @@ -45457,7 +48172,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdan10", 11) == 0) { { -return dev_storage + 961; +return dev_storage + 1089; } } @@ -45472,7 +48187,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdam10", 11) == 0) { { -return dev_storage + 946; +return dev_storage + 1074; } } @@ -45487,7 +48202,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdal10", 11) == 0) { { -return dev_storage + 931; +return dev_storage + 1059; } } @@ -45502,7 +48217,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdak10", 11) == 0) { { -return dev_storage + 916; +return dev_storage + 1044; } } @@ -45517,7 +48232,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaj10", 11) == 0) { { -return dev_storage + 901; +return dev_storage + 1029; } } @@ -45532,7 +48247,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdai10", 11) == 0) { { -return dev_storage + 886; +return dev_storage + 1014; } } @@ -45547,7 +48262,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdah10", 11) == 0) { { -return dev_storage + 871; +return dev_storage + 999; } } @@ -45562,7 +48277,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdag10", 11) == 0) { { -return dev_storage + 856; +return dev_storage + 984; } } @@ -45577,7 +48292,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaf10", 11) == 0) { { -return dev_storage + 841; +return dev_storage + 969; } } @@ -45592,7 +48307,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdae10", 11) == 0) { { -return dev_storage + 826; +return dev_storage + 954; } } @@ -45607,7 +48322,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdad10", 11) == 0) { { -return dev_storage + 811; +return dev_storage + 939; } } @@ -45622,7 +48337,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdac10", 11) == 0) { { -return dev_storage + 796; +return dev_storage + 924; } } @@ -45637,7 +48352,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdab10", 11) == 0) { { -return dev_storage + 781; +return dev_storage + 909; } } @@ -45652,7 +48367,7 @@ return NULL; if (strncmp (KR_keyword, "/dev/sdaa10", 11) == 0) { { -return dev_storage + 766; +return dev_storage + 894; } } @@ -45682,13 +48397,13 @@ return NULL; } } case 12: - switch (KR_keyword [5]) + switch (KR_keyword [10]) { case 'w': if (strncmp (KR_keyword, "/dev/windows", 12) == 0) { { -return dev_storage + 2573; +return dev_storage + 2701; } } @@ -45699,11 +48414,11 @@ return NULL; } } - case 'u': + case 'o': if (strncmp (KR_keyword, "/dev/urandom", 12) == 0) { { -return dev_storage + 2572; +return dev_storage + 2700; } } @@ -45714,11 +48429,11 @@ return NULL; } } - case 'c': + case 'l': if (strncmp (KR_keyword, "/dev/console", 12) == 0) { { -return dev_storage + 84; +return dev_storage + 148; } } @@ -45727,6 +48442,453 @@ return dev_storage + 84; { return NULL; +} + } + case '2': + switch (KR_keyword [11]) + { + case '7': + if (strncmp (KR_keyword, "/dev/cons127", 12) == 0) + { +{ +return dev_storage + 147; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, "/dev/cons126", 12) == 0) + { +{ +return dev_storage + 146; + +} + } + else + { +{ +return NULL; + +} + } + case '5': + if (strncmp (KR_keyword, "/dev/cons125", 12) == 0) + { +{ +return dev_storage + 145; + +} + } + else + { +{ +return NULL; + +} + } + case '4': + if (strncmp (KR_keyword, "/dev/cons124", 12) == 0) + { +{ +return dev_storage + 144; + +} + } + else + { +{ +return NULL; + +} + } + case '3': + if (strncmp (KR_keyword, "/dev/cons123", 12) == 0) + { +{ +return dev_storage + 143; + +} + } + else + { +{ +return NULL; + +} + } + case '2': + if (strncmp (KR_keyword, "/dev/cons122", 12) == 0) + { +{ +return dev_storage + 142; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, "/dev/cons121", 12) == 0) + { +{ +return dev_storage + 141; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, "/dev/cons120", 12) == 0) + { +{ +return dev_storage + 140; + +} + } + else + { +{ +return NULL; + +} + } + default: +{ +return NULL; + +} + } + case '1': + switch (KR_keyword [11]) + { + case '9': + if (strncmp (KR_keyword, "/dev/cons119", 12) == 0) + { +{ +return dev_storage + 139; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/cons118", 12) == 0) + { +{ +return dev_storage + 138; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/cons117", 12) == 0) + { +{ +return dev_storage + 137; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, "/dev/cons116", 12) == 0) + { +{ +return dev_storage + 136; + +} + } + else + { +{ +return NULL; + +} + } + case '5': + if (strncmp (KR_keyword, "/dev/cons115", 12) == 0) + { +{ +return dev_storage + 135; + +} + } + else + { +{ +return NULL; + +} + } + case '4': + if (strncmp (KR_keyword, "/dev/cons114", 12) == 0) + { +{ +return dev_storage + 134; + +} + } + else + { +{ +return NULL; + +} + } + case '3': + if (strncmp (KR_keyword, "/dev/cons113", 12) == 0) + { +{ +return dev_storage + 133; + +} + } + else + { +{ +return NULL; + +} + } + case '2': + if (strncmp (KR_keyword, "/dev/cons112", 12) == 0) + { +{ +return dev_storage + 132; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, "/dev/cons111", 12) == 0) + { +{ +return dev_storage + 131; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, "/dev/cons110", 12) == 0) + { +{ +return dev_storage + 130; + +} + } + else + { +{ +return NULL; + +} + } + default: +{ +return NULL; + +} + } + case '0': + switch (KR_keyword [11]) + { + case '9': + if (strncmp (KR_keyword, "/dev/cons109", 12) == 0) + { +{ +return dev_storage + 129; + +} + } + else + { +{ +return NULL; + +} + } + case '8': + if (strncmp (KR_keyword, "/dev/cons108", 12) == 0) + { +{ +return dev_storage + 128; + +} + } + else + { +{ +return NULL; + +} + } + case '7': + if (strncmp (KR_keyword, "/dev/cons107", 12) == 0) + { +{ +return dev_storage + 127; + +} + } + else + { +{ +return NULL; + +} + } + case '6': + if (strncmp (KR_keyword, "/dev/cons106", 12) == 0) + { +{ +return dev_storage + 126; + +} + } + else + { +{ +return NULL; + +} + } + case '5': + if (strncmp (KR_keyword, "/dev/cons105", 12) == 0) + { +{ +return dev_storage + 125; + +} + } + else + { +{ +return NULL; + +} + } + case '4': + if (strncmp (KR_keyword, "/dev/cons104", 12) == 0) + { +{ +return dev_storage + 124; + +} + } + else + { +{ +return NULL; + +} + } + case '3': + if (strncmp (KR_keyword, "/dev/cons103", 12) == 0) + { +{ +return dev_storage + 123; + +} + } + else + { +{ +return NULL; + +} + } + case '2': + if (strncmp (KR_keyword, "/dev/cons102", 12) == 0) + { +{ +return dev_storage + 122; + +} + } + else + { +{ +return NULL; + +} + } + case '1': + if (strncmp (KR_keyword, "/dev/cons101", 12) == 0) + { +{ +return dev_storage + 121; + +} + } + else + { +{ +return NULL; + +} + } + case '0': + if (strncmp (KR_keyword, "/dev/cons100", 12) == 0) + { +{ +return dev_storage + 120; + +} + } + else + { +{ +return NULL; + +} + } + default: +{ +return NULL; + } } default: diff --git a/winsup/cygwin/devices.in b/winsup/cygwin/devices.in index c43f11c0f..c337053bb 100644 --- a/winsup/cygwin/devices.in +++ b/winsup/cygwin/devices.in @@ -142,9 +142,9 @@ const device dev_error_storage = %% "/dev", BRACK(FH_DEV), "", exists, S_IFDIR "/dev/tty", BRACK(FH_TTY), "/dev/tty", exists, S_IFCHR -"/dev/pty%(0-63)d", BRACK(FHDEV(DEV_PTYS_MAJOR, {$1})), "/dev/pty{$1}", exists_pty, S_IFCHR, =ptys_dev -":ptym%(0-63)d", BRACK(FHDEV(DEV_PTYM_MAJOR, {$1})), "/dev/ptym{$1}", exists_internal, S_IFCHR, =ptym_dev -"/dev/cons%(0-63)d", BRACK(FHDEV(DEV_CONS_MAJOR, {$1})), "/dev/cons{$1}", exists_console, S_IFCHR, =cons_dev +"/dev/pty%(0-127)d", BRACK(FHDEV(DEV_PTYS_MAJOR, {$1})), "/dev/pty{$1}", exists_pty, S_IFCHR, =ptys_dev +":ptym%(0-127)d", BRACK(FHDEV(DEV_PTYM_MAJOR, {$1})), "/dev/ptym{$1}", exists_internal, S_IFCHR, =ptym_dev +"/dev/cons%(0-127)d", BRACK(FHDEV(DEV_CONS_MAJOR, {$1})), "/dev/cons{$1}", exists_console, S_IFCHR, =cons_dev "/dev/console", BRACK(FH_CONSOLE), "/dev/console", exists_console, S_IFCHR, =console_dev "/dev/ptmx", BRACK(FH_PTMX), "/dev/ptmx", exists, S_IFCHR "/dev/windows", BRACK(FH_WINDOWS), "\\Device\\Null", exists_ntdev, S_IFCHR diff --git a/winsup/cygwin/release/1.7.36 b/winsup/cygwin/release/1.7.36 index 0515ef96e..f01e497fe 100644 --- a/winsup/cygwin/release/1.7.36 +++ b/winsup/cygwin/release/1.7.36 @@ -11,6 +11,8 @@ What's new: What changed: ------------- +- The maximum number of PTYs has been raised from 64 to 128. + Bug Fixes --------- diff --git a/winsup/cygwin/tty.h b/winsup/cygwin/tty.h index 9790a365a..f3b6578c8 100644 --- a/winsup/cygwin/tty.h +++ b/winsup/cygwin/tty.h @@ -15,7 +15,7 @@ details. */ #define INP_BUFFER_SIZE 256 #define OUT_BUFFER_SIZE 256 -#define NTTYS 64 +#define NTTYS 128 #define real_tty_attached(p) ((p)->ctty > 0 && !iscons_dev ((p)->ctty)) /* Input/Output/ioctl events */ From cf380399752a1b4e0a8f61cb386b01a8e8194bff Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 7 Apr 2015 12:16:07 +0200 Subject: [PATCH 042/109] Remove unused 32/64 bit tty code * tty.h (class tty): Remove unused 32/64 bit interoperability considerations. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/tty.h | 21 +++------------------ 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index de2dc2379..540bcb26f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-07 Corinna Vinschen + + * tty.h (class tty): Remove unused 32/64 bit interoperability + considerations. + 2015-04-07 Corinna Vinschen * tty.h (NTTYS): Raise to 128. diff --git a/winsup/cygwin/tty.h b/winsup/cygwin/tty.h index f3b6578c8..27d43f731 100644 --- a/winsup/cygwin/tty.h +++ b/winsup/cygwin/tty.h @@ -90,29 +90,14 @@ public: pid_t master_pid; /* PID of tty master process */ private: - /* Since tty is shared, the HANDLEs must be 32 and 64 bit clean. The below - code makes sure of that by setting the upper 4 byte of the union to 0 - when writing the handle value from a 32 bit process. Fortunately the - actual values are 32 bit on both platforms, so the HANDLES can be - used on both platforms. */ - union { - HANDLE _from_master; - LARGE_INTEGER _fm_dummy; - }; - union { - HANDLE _to_master; - LARGE_INTEGER _tm_dummy; - }; + HANDLE _from_master; + HANDLE _to_master; + public: HANDLE from_master() const { return _from_master; } HANDLE to_master() const { return _to_master; } -#ifdef __x86_64__ void set_from_master (HANDLE h) { _from_master = h; } void set_to_master (HANDLE h) { _to_master = h; } -#else - void set_from_master (HANDLE h) { _fm_dummy.HighPart = 0; _from_master = h; } - void set_to_master (HANDLE h) { _tm_dummy.HighPart = 0; _to_master = h; } -#endif int read_retval; bool was_opened; /* True if opened at least once. */ From 5707076d0c975b70645fc770a983a5ff8e56a1fb Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 7 Apr 2015 14:51:44 +0100 Subject: [PATCH 043/109] Always include the .csstart section in RL78 executables. * rl78/rl78.ld (.csstart): Add a KEEP directive. * rl78/rl78-sim.ld (.csstart): Add a KEEP directive. --- libgloss/ChangeLog | 5 +++++ libgloss/rl78/rl78-sim.ld | 2 +- libgloss/rl78/rl78.ld | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 13497906a..d2678d16a 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,8 @@ +2015-04-07 Nick Clifton + + * rl78/rl78.ld (.csstart): Add a KEEP directive. + * rl78/rl78-sim.ld (.csstart): Add a KEEP directive. + 2015-03-05 Nick Clifton * v850/sim.ld: Add a .note.renesas section. diff --git a/libgloss/rl78/rl78-sim.ld b/libgloss/rl78/rl78-sim.ld index f54105dbf..26d62ac40 100644 --- a/libgloss/rl78/rl78-sim.ld +++ b/libgloss/rl78/rl78-sim.ld @@ -66,7 +66,7 @@ SECTIONS /* CubeSuite always starts at 0xd8. */ .csstart : { - *(.csstart) + KEEP (*(.csstart)) } > ROM /* For code that must be in the first 64k, or could fill unused diff --git a/libgloss/rl78/rl78.ld b/libgloss/rl78/rl78.ld index ab137f50f..d560b1409 100644 --- a/libgloss/rl78/rl78.ld +++ b/libgloss/rl78/rl78.ld @@ -66,7 +66,7 @@ SECTIONS /* CubeSuite always starts at 0xd8. */ .csstart : { - *(.csstart) + KEEP (*(.csstart)) } > ROM /* For code that must be in the first 64k, or could fill unused From 6326a8c0f3a951fb46d0097c811741e7bd9a6afb Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 8 Apr 2015 10:01:59 +0200 Subject: [PATCH 044/109] Remove __acl16 from official header * include/cyggwin/acl.h (struct __acl16): Move from here... * sec_acl.cc: ...to here. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/include/cygwin/acl.h | 10 ---------- winsup/cygwin/sec_acl.cc | 6 ++++++ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 540bcb26f..efe62621d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-08 Corinna Vinschen + + * include/cyggwin/acl.h (struct __acl16): Move from here... + * sec_acl.cc: ...to here. + 2015-04-07 Corinna Vinschen * tty.h (class tty): Remove unused 32/64 bit interoperability diff --git a/winsup/cygwin/include/cygwin/acl.h b/winsup/cygwin/include/cygwin/acl.h index dcdfc0076..b7cbf03f3 100644 --- a/winsup/cygwin/include/cygwin/acl.h +++ b/winsup/cygwin/include/cygwin/acl.h @@ -66,16 +66,6 @@ extern "C" { #define MASK CLASS_OBJ #define OTHER OTHER_OBJ -#ifdef __INSIDE_CYGWIN__ -#ifndef __x86_64__ -typedef struct __acl16 { - int a_type; - __uid16_t a_id; - mode_t a_perm; -} __aclent16_t; -#endif -#endif - typedef struct acl { int a_type; /* entry type */ uid_t a_id; /* UID | GID */ diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 749ba9437..f1f474eb2 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -1323,6 +1323,12 @@ EXPORT_ALIAS (aclfrompbits32, aclfrompbits) EXPORT_ALIAS (acltotext32, acltotext) EXPORT_ALIAS (aclfromtext32, aclfromtext) #else +typedef struct __acl16 { + int a_type; + __uid16_t a_id; + mode_t a_perm; +} __aclent16_t; + /* __aclent16_t and aclent_t have same size and same member offsets */ static aclent_t * acl16to32 (__aclent16_t *aclbufp, int nentries) From 0411e862166cbd3ce6febcf0b9517d1b826befe6 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 8 Apr 2015 10:12:27 +0200 Subject: [PATCH 045/109] Use NULL dey ACE rather than special Cygwin ACE * sec_acl.cc: Change preceeding comment explaining new-style ACLs. Describe how to generate deny ACEs in more detail. Accommodate the fact that a NULL deny ACE is used for {DEF_}CLASS_OBJ, rather than a special Cygwin ACE. Improve further comments. (CYG_ACE_NEW_STYLE): Define. (get_posix_access): Change from Cygwin ACE to NULL deny ACE. Fix CLASS_OBJ handling to generate CLASS_OBJ and DEF_CLASS_OBJ from a single NULL deny ACE if the inheritance flags say so. * sec_helper.cc (well_known_cygwin_sid): Remove. * security.h (well_known_cygwin_sid): Drop declaration. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 13 +++++ winsup/cygwin/sec_acl.cc | 109 +++++++++++++++++++++--------------- winsup/cygwin/sec_helper.cc | 2 - winsup/cygwin/security.h | 1 - 4 files changed, 76 insertions(+), 49 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index efe62621d..6210391f6 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,16 @@ +2015-04-08 Corinna Vinschen + + * sec_acl.cc: Change preceeding comment explaining new-style ACLs. + Describe how to generate deny ACEs in more detail. Accommodate the + fact that a NULL deny ACE is used for {DEF_}CLASS_OBJ, rather than + a special Cygwin ACE. Improve further comments. + (CYG_ACE_NEW_STYLE): Define. + (get_posix_access): Change from Cygwin ACE to NULL deny ACE. Fix + CLASS_OBJ handling to generate CLASS_OBJ and DEF_CLASS_OBJ from a single + NULL deny ACE if the inheritance flags say so. + * sec_helper.cc (well_known_cygwin_sid): Remove. + * security.h (well_known_cygwin_sid): Drop declaration. + 2015-04-08 Corinna Vinschen * include/cyggwin/acl.h (struct __acl16): Move from here... diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index f1f474eb2..55ff1bea7 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -27,23 +27,30 @@ details. */ /* How does a correctly constructed new-style Windows ACL claiming to be a POSIX ACL look like? - - Cygwin ACE (special bits, CLASS_OBJ). + - NULL ACE (special bits, CLASS_OBJ). - - If a USER entry has more permissions than any group, Everyone, or if it - has more permissions than allowed by the CLASS_OBJ entry: + - USER_OBJ deny. If the user has less permissions than the sum of CLASS_OBJ + (or GROUP_OBJ if CLASS_OBJ doesn't exist) and OTHER_OBJ, deny the excess + permissions so that group and other perms don't spill into the owner perms. - USER deny ACEs == POSIX allow - & ^(mask | all group allows | Everyone allow) + USER_OBJ deny ACE == ~USER_OBJ & (CLASS_OBJ | OTHER_OBJ) + or + USER_OBJ deny ACE == ~USER_OBJ & (GROUP_OBJ | OTHER_OBJ) + + - USER deny. If a user has different permissions from CLASS_OBJ, or if the + user has less permissions than OTHER_OBJ, deny the excess permissions. + + USER deny ACE == (USER ^ CLASS_OBJ) | (~USER & OTHER_OBJ) - USER_OBJ allow ACE - USER allow ACEs The POSIX permissions returned for a USER entry are the allow bits alone! - - If a GROUP entry has more permissions than Everyone, or if it has more - permissions than allowed by the CLASS_OBJ entry: + - GROUP{_OBJ} deny. If a group has more permissions than CLASS_OBJ, + or less permissions than OTHER_OBJ, deny the excess permissions. - GROUP deny ACEs == POSIX allow & ^(mask | Everyone allow) + GROUP{_OBJ} deny ACEs == (GROUP & ~CLASS_OBJ) | (~GROUP & OTHER_OBJ) - GROUP_OBJ allow ACE - GROUP allow ACEs @@ -54,15 +61,16 @@ details. */ Rinse and repeat for default ACEs with INHERIT flags set. - - Default Cygwin ACE (S_ISGID, CLASS_OBJ). */ + - Default NULL ACE (S_ISGID, CLASS_OBJ). */ /* POSIX <-> Win32 */ -/* Historically, these bits are stored in a NULL SID ACE. To distinguish - the new ACL style from the old one, we're now using an invented SID, the - Cygwin SID (S-1-0-1132029815). The new ACEs can exist twice in an ACL, - the "normal one" containg CLASS_OBJ and special bits, and the one with - INHERIT bit set to pass the DEF_CLASS_OBJ bits and the S_ISGID bit on. */ +/* Historically, these bits are stored in a NULL SID ACE. To distinguish the + new ACL style from the old one, we're using an access denied ACE, plus + setting an as yet unused bit in the access mask. The new ACEs can exist + twice in an ACL, the "normal one" containing CLASS_OBJ and special bits + and the one with INHERIT bit set to pass the DEF_CLASS_OBJ bits and the + S_ISGID bit on. */ #define CYG_ACE_ISVTX 0x001 /* 0x200 <-> 0x001 */ #define CYG_ACE_ISGID 0x002 /* 0x400 <-> 0x002 */ #define CYG_ACE_ISUID 0x004 /* 0x800 <-> 0x004 */ @@ -81,6 +89,7 @@ details. */ #define CYG_ACE_MASK_TO_WIN(val) \ ((((val) & S_IRWXO) << 3) \ | CYG_ACE_MASK_VALID) +#define CYG_ACE_NEW_STYLE READ_CONTROL /* New style if set. */ static int searchace (aclent_t *aclp, int nentries, int type, uid_t id = ILLEGAL_UID) @@ -386,7 +395,9 @@ setacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp, return set_file_sd (handle, pc, sd_ret, false); } -/* Temporary access denied bits */ +/* Temporary access denied bits used by getace and get_posix_access during + Windows ACL processing. These bits get removed before the created POSIX + ACL gets published. */ #define DENY_R 040000 #define DENY_W 020000 #define DENY_X 010000 @@ -545,44 +556,50 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, if (ace_sid == well_known_null_sid) { - /* Old-style or non-Cygwin ACL. Fetch only the special bits. */ + /* Fetch special bits. */ attr |= CYG_ACE_ISBITS_TO_POSIX (ace->Mask); - continue; - } - if (ace_sid == well_known_cygwin_sid) - { - /* New-style ACL. Note the fact that a mask value is present since - that changes how getace fetches the information. That's fine, - because the Cygwin SID ACE is supposed to precede all USER, GROUP - and GROUP_OBJ entries. Any ACL not created that way has been - rearranged by the Windows functionality to create the brain-dead - "canonical" ACL order and is broken anyway. */ - attr |= CYG_ACE_ISBITS_TO_POSIX (ace->Mask); - if (ace->Mask & CYG_ACE_MASK_VALID) + if (ace->Header.AceType == ACCESS_DENIED_ACE_TYPE + && ace->Mask & CYG_ACE_NEW_STYLE) { - new_style = true; - type = (ace->Header.AceFlags & SUB_CONTAINERS_AND_OBJECTS_INHERIT) - ? DEF_CLASS_OBJ : CLASS_OBJ; - if ((pos = searchace (lacl, MAX_ACL_ENTRIES, type)) >= 0) + /* New-style ACL. Note the fact that a mask value is present + since that changes how getace fetches the information. That's + fine, because the Cygwin SID ACE is supposed to precede all + USER, GROUP and GROUP_OBJ entries. Any ACL not created that + way has been rearranged by the Windows functionality to create + the brain-dead "canonical" ACL order and is broken anyway. */ + attr |= CYG_ACE_ISBITS_TO_POSIX (ace->Mask); + if (ace->Mask & CYG_ACE_MASK_VALID) { - lacl[pos].a_type = type; - lacl[pos].a_id = ILLEGAL_GID; - lacl[pos].a_perm = CYG_ACE_MASK_TO_POSIX (ace->Mask); - } - if (type == CLASS_OBJ) /* Needed for POSIX permissions. */ - { - has_class_perm = true; - class_perm = lacl[pos].a_perm; - } - else - { - has_def_class_perm = true; - def_class_perm = lacl[pos].a_perm; + new_style = true; + if (!(ace->Header.AceFlags & INHERIT_ONLY)) + { + if ((pos = searchace (lacl, MAX_ACL_ENTRIES, CLASS_OBJ)) + >= 0) + { + lacl[pos].a_type = CLASS_OBJ; + lacl[pos].a_id = ILLEGAL_GID; + lacl[pos].a_perm = CYG_ACE_MASK_TO_POSIX (ace->Mask); + } + has_class_perm = true; + class_perm = lacl[pos].a_perm; + } + if (ace->Header.AceFlags & SUB_CONTAINERS_AND_OBJECTS_INHERIT) + { + if ((pos = searchace (lacl, MAX_ACL_ENTRIES, + DEF_CLASS_OBJ)) >= 0) + { + lacl[pos].a_type = DEF_CLASS_OBJ; + lacl[pos].a_id = ILLEGAL_GID; + lacl[pos].a_perm = CYG_ACE_MASK_TO_POSIX (ace->Mask); + } + has_def_class_perm = true; + def_class_perm = lacl[pos].a_perm; + } } } continue; } - else if (ace_sid == owner_sid) + if (ace_sid == owner_sid) { type = USER_OBJ; id = uid; diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc index 1ea69c372..753f15673 100644 --- a/winsup/cygwin/sec_helper.cc +++ b/winsup/cygwin/sec_helper.cc @@ -40,8 +40,6 @@ SECURITY_ATTRIBUTES NO_COPY_RO sec_all_nih = MKSID (well_known_null_sid, "S-1-0-0", SECURITY_NULL_SID_AUTHORITY, 1, SECURITY_NULL_RID); -MKSID (well_known_cygwin_sid, "S-1-0-1132029815", - SECURITY_NULL_SID_AUTHORITY, 1, 0x43796777); /* "Cygw" */ MKSID (well_known_world_sid, "S-1-1-0", SECURITY_WORLD_SID_AUTHORITY, 1, SECURITY_WORLD_RID); MKSID (well_known_local_sid, "S-1-2-0", diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h index 7bf0270ef..0378814ca 100644 --- a/winsup/cygwin/security.h +++ b/winsup/cygwin/security.h @@ -393,7 +393,6 @@ public: }; extern cygpsid well_known_null_sid; -extern cygpsid well_known_cygwin_sid; extern cygpsid well_known_world_sid; extern cygpsid well_known_local_sid; extern cygpsid well_known_console_logon_sid; From 0f4510230a14ffe3c941e7f17f12a9bb89383383 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 8 Apr 2015 11:00:08 +0200 Subject: [PATCH 046/109] Introduce sidfromuid and sidfromgid * pwdgrp.h (sidfromuid): New inline function. (sidfromgid): Ditto. * fhandler_disk_file.cc (fhandler_disk_file::fchown): Use sidfromuid. * quotactl.cc (quotactl): Use sidfromuid and sidfromgid. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/fhandler_disk_file.cc | 4 ++-- winsup/cygwin/pwdgrp.h | 16 ++++++++++++++++ winsup/cygwin/quotactl.cc | 17 +++++------------ 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 6210391f6..2c170b4fc 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2015-04-08 Corinna Vinschen + + * pwdgrp.h (sidfromuid): New inline function. + (sidfromgid): Ditto. + * fhandler_disk_file.cc (fhandler_disk_file::fchown): Use sidfromuid. + * quotactl.cc (quotactl): Use sidfromuid and sidfromgid. + 2015-04-08 Corinna Vinschen * sec_acl.cc: Change preceeding comment explaining new-style ACLs. diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 6a425674a..f5edb03de 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -989,10 +989,10 @@ fhandler_disk_file::fchown (uid_t uid, gid_t gid) the standard UNIX accounts, we're faking success. */ if (res == -1 && pc.fs_is_samba ()) { - cygsid sid; + PSID sid; if (old_uid == ILLEGAL_UID - || (sid.getfrompw (internal_getpwuid (old_uid)) + || ((sid = sidfromuid (old_uid, NULL)) != NO_SID && RtlEqualPrefixSid (sid, well_known_samba_unix_user_fake_sid))) { diff --git a/winsup/cygwin/pwdgrp.h b/winsup/cygwin/pwdgrp.h index dc718c596..a64cb0f5f 100644 --- a/winsup/cygwin/pwdgrp.h +++ b/winsup/cygwin/pwdgrp.h @@ -254,3 +254,19 @@ inline BOOL cygsid::getfrompw (const struct passwd *pw) inline BOOL cygsid::getfromgr (const struct group *gr) { return (*this = gr ? (PSID) ((pg_grp *) gr)->sid : NO_SID) != NO_SID; } + +/* Use these functions if you just need the PSID. */ +inline PSID sidfromuid (uid_t uid, cyg_ldap *pldap) + { + struct passwd *pw = internal_getpwuid (uid, pldap); + if (pw) + return (PSID) ((pg_pwd *) pw)->sid; + return NO_SID; + } +inline PSID sidfromgid (gid_t gid, cyg_ldap *pldap) + { + struct group *gr = internal_getgrgid (gid, pldap); + if (gr) + return (PSID) ((pg_grp *) gr)->sid; + return NO_SID; + } diff --git a/winsup/cygwin/quotactl.cc b/winsup/cygwin/quotactl.cc index 96c6134e8..f4c325bd5 100644 --- a/winsup/cygwin/quotactl.cc +++ b/winsup/cygwin/quotactl.cc @@ -1,6 +1,6 @@ /* quotactl.cc: code for manipulating disk quotas - Copyright 2014 Red Hat, Inc. + Copyright 2014, 2015 Red Hat, Inc. This file is part of Cygwin. @@ -28,7 +28,7 @@ extern "C" int quotactl (int cmd, const char *special, int id, caddr_t addr) { ACCESS_MASK access = FILE_READ_DATA; - cygsid sid; + PSID sid = NO_SID; path_conv pc; tmp_pathbuf tp; UNICODE_STRING path; @@ -75,18 +75,11 @@ quotactl (int cmd, const char *special, int id, caddr_t addr) /* Windows feature: Default limits. Get or set them with id == -1. */ if (id != -1) { - struct passwd *pw = NULL; - struct group *gr = NULL; - if (type == USRQUOTA) - pw = internal_getpwuid (id); - else - gr = internal_getgrgid (id); - if (pw) - sid.getfrompw (pw); - else if (gr) - sid.getfromgr (gr); + sid = sidfromuid (id, NULL); else + sid = sidfromgid (id, NULL); + if (sid == NO_SID) { set_errno (EINVAL); return -1; From 5b8fb10d65871174e7b2ae45a3cd7c43c7a6a1f3 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 8 Apr 2015 10:04:12 +0100 Subject: [PATCH 047/109] Add .note and DWARF3 sections to RX linker scripts. * rx/rx.ld: Add .note and DWARF3 sections. * rx/rx-sim.ld: Likewise. --- libgloss/ChangeLog | 5 +++++ libgloss/rx/rx-sim.ld | 6 ++++++ libgloss/rx/rx.ld | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index d2678d16a..fc3674ebc 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,8 @@ +2015-04-08 Nick Clifton + + * rx/rx.ld: Add .note and DWARF3 sections. + * rx/rx-sim.ld: Likewise. + 2015-04-07 Nick Clifton * rl78/rl78.ld (.csstart): Add a KEEP directive. diff --git a/libgloss/rx/rx-sim.ld b/libgloss/rx/rx-sim.ld index 4acc6cb87..b5802c511 100644 --- a/libgloss/rx/rx-sim.ld +++ b/libgloss/rx/rx-sim.ld @@ -188,6 +188,7 @@ SECTIONS } /* The rest are all not normally part of the runtime image. */ + .note : { *(.note) } /* Stabs debugging sections. */ .stab 0 : { *(.stab) } @@ -222,5 +223,10 @@ SECTIONS .debug_funcnames 0 : { *(.debug_funcnames) } .debug_typenames 0 : { *(.debug_typenames) } .debug_varnames 0 : { *(.debug_varnames) } + /* DWARF 3 */ + .debug_pubtypes 0 : { *(.debug_pubtypes) } + .debug_ranges 0 : { *(.debug_ranges) } + /* DWARF Extension. */ + .debug_macro 0 : { *(.debug_macro) } /DISCARD/ : { *(.note.GNU-stack) } } diff --git a/libgloss/rx/rx.ld b/libgloss/rx/rx.ld index 7aa263acc..f56fe01ea 100644 --- a/libgloss/rx/rx.ld +++ b/libgloss/rx/rx.ld @@ -192,6 +192,7 @@ SECTIONS } /* The rest are all not normally part of the runtime image. */ + .note : { *(.note) } /* Stabs debugging sections. */ .stab 0 : { *(.stab) } @@ -226,5 +227,10 @@ SECTIONS .debug_funcnames 0 : { *(.debug_funcnames) } .debug_typenames 0 : { *(.debug_typenames) } .debug_varnames 0 : { *(.debug_varnames) } + /* DWARF 3 */ + .debug_pubtypes 0 : { *(.debug_pubtypes) } + .debug_ranges 0 : { *(.debug_ranges) } + /* DWARF Extension. */ + .debug_macro 0 : { *(.debug_macro) } /DISCARD/ : { *(.note.GNU-stack) } } From ab8bc7614c596ba842b014cc55adce8e8715b9d6 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 9 Apr 2015 09:20:00 +0100 Subject: [PATCH 048/109] For the RX port, avoid using string instructions when __RX_DISALLOW_STRING_INSNS__ is defined. * rx/crt0.S (_start): If string instructions are not allowed, avoid using SMOVF. * libc/machine/rx/memchr.S: Add non-string insn using version. * libc/machine/rx/memcpy.S: Likewise. * libc/machine/rx/memmove.S: Likewise. * libc/machine/rx/mempcpy.S: Likewise. * libc/machine/rx/strcat.S: Likewise. * libc/machine/rx/strcmp.S: Likewise. * libc/machine/rx/strcpy.S: Likewise. * libc/machine/rx/strlen.S: Likewise. * libc/machine/rx/strncat.S: Likewise. * libc/machine/rx/strncmp.S: Likewise. * libc/machine/rx/strncpy.S: Likewise. --- include/elf/rx.h | 5 +++++ libgloss/ChangeLog | 5 +++++ libgloss/rx/crt0.S | 15 ++++++++++++- newlib/ChangeLog | 14 ++++++++++++ newlib/libc/machine/rx/memchr.S | 19 ++++++++++++++++ newlib/libc/machine/rx/memcpy.S | 21 ++++++++++++++++++ newlib/libc/machine/rx/memmove.S | 37 ++++++++++++++++++++++++++++++++ newlib/libc/machine/rx/mempcpy.S | 17 +++++++++++++++ newlib/libc/machine/rx/memset.S | 3 +++ newlib/libc/machine/rx/strcat.S | 19 ++++++++++++++++ newlib/libc/machine/rx/strcmp.S | 18 ++++++++++++++++ newlib/libc/machine/rx/strcpy.S | 14 ++++++++++++ newlib/libc/machine/rx/strlen.S | 13 +++++++++++ newlib/libc/machine/rx/strncat.S | 23 ++++++++++++++++++++ newlib/libc/machine/rx/strncmp.S | 28 ++++++++++++++++++++++++ newlib/libc/machine/rx/strncpy.S | 23 ++++++++++++++++++++ 16 files changed, 273 insertions(+), 1 deletion(-) diff --git a/include/elf/rx.h b/include/elf/rx.h index 83980853e..c17128c48 100644 --- a/include/elf/rx.h +++ b/include/elf/rx.h @@ -120,6 +120,11 @@ END_RELOC_NUMBERS (R_RX_max) #define E_FLAG_RX_PID (1 << 2) /* Unofficial - DJ */ #define E_FLAG_RX_ABI (1 << 3) /* Binary passes stacked arguments using natural alignment. Unofficial - NC. */ +#define E_FLAG_RX_SINSNS_SET (1 << 6) /* Set if bit-5 is significant. */ +#define E_FLAG_RX_SINSNS_YES (1 << 7) /* Set if string instructions are used in the binary. */ +#define E_FLAG_RX_SINSNS_NO 0 /* Bit-5 if this binary must not be linked with a string instruction using binary. */ +#define E_FLAG_RX_SINSNS_MASK (3 << 6) /* Mask of bits used to determine string instruction use. */ + /* These define the addend field of R_RX_RH_RELAX relocations. */ #define RX_RELAXA_IMM6 0x00000010 /* Imm8/16/24/32 at bit offset 6. */ #define RX_RELAXA_IMM12 0x00000020 /* Imm8/16/24/32 at bit offset 12. */ diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index fc3674ebc..37cb4a581 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,8 @@ +2015-04-09 Nick Clifton + + * rx/crt0.S (_start): If string instructions are not allowed, + avoid using SMOVF. + 2015-04-08 Nick Clifton * rx/rx.ld: Add .note and DWARF3 sections. diff --git a/libgloss/rx/crt0.S b/libgloss/rx/crt0.S index 222742352..6d7089d4d 100644 --- a/libgloss/rx/crt0.S +++ b/libgloss/rx/crt0.S @@ -40,11 +40,24 @@ _start: mov #__stack, r0 mvtc #__vectors, intb + /* Copy the .data section from ROM into RAM. */ mov #__datastart, r1 mov #__romdatastart, r2 mov #__romdatacopysize, r3 - smovf +#ifdef __RX_DISALLOW_STRING_INSNS__ + cmp #0, r3 + beq 2f +1: mov.b [r2+], r5 + mov.b r5, [r1+] + sub #1, r3 + bne 1b +2: +#else + smovf +#endif + + /* Initialise the contents of the .bss section. */ mov #__bssstart, r1 mov #0, r2 mov #__bsssize, r3 diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 470978d48..bca127755 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,17 @@ +2015-04-09 Nick Clifton + + * libc/machine/rx/memchr.S: Add non-string insn using version. + * libc/machine/rx/memcpy.S: Likewise. + * libc/machine/rx/memmove.S: Likewise. + * libc/machine/rx/mempcpy.S: Likewise. + * libc/machine/rx/strcat.S: Likewise. + * libc/machine/rx/strcmp.S: Likewise. + * libc/machine/rx/strcpy.S: Likewise. + * libc/machine/rx/strlen.S: Likewise. + * libc/machine/rx/strncat.S: Likewise. + * libc/machine/rx/strncmp.S: Likewise. + * libc/machine/rx/strncpy.S: Likewise. + 2015-04-01 Corinna Vinschen * libc/include/stdint.h: Throughout add parens around MIN/MAX values. diff --git a/newlib/libc/machine/rx/memchr.S b/newlib/libc/machine/rx/memchr.S index 937753cef..cdc97c874 100644 --- a/newlib/libc/machine/rx/memchr.S +++ b/newlib/libc/machine/rx/memchr.S @@ -5,9 +5,28 @@ .global _memchr .type _memchr,@function _memchr: + ;; R1: string pointer + ;; R2: byte sought + ;; R3: max number to scan +#ifdef __RX_DISALLOW_STRING_INSNS__ + mov.b r2, r2 ; The mov.b below sign extends as it loads, so make sure that r2 is sign-extended as well. +2: cmp #0, r3 + beq 1f + sub #1, r3 + mov.b [r1+], r5 + cmp r5, r2 + bne 2b + + sub #1, r1 ; We have found a match, bit now R1 points to the byte after the match. +1: rts +#else cmp #0, r3 ; If r3 is 0 suntil.b will do nothing and not set any flags... stz #1, r1 ; ...so store 1 into r1. It will be decremented by the SUB later. suntil.b ; Search until *r1 == r2 or r3 bytes have been examined. stnz #1, r1 ; If no match was found return NULL. sub #1, r1 ; suntil.b leaves r1 pointing at the address *after* the match. rts +#endif + + .size _memchr, . - _memchr + diff --git a/newlib/libc/machine/rx/memcpy.S b/newlib/libc/machine/rx/memcpy.S index 3e0d50001..eb671c0ae 100644 --- a/newlib/libc/machine/rx/memcpy.S +++ b/newlib/libc/machine/rx/memcpy.S @@ -4,7 +4,28 @@ .global _memcpy .type _memcpy,@function _memcpy: +#ifdef __RX_DISALLOW_STRING_INSNS__ + /* Do not use the string instructions - they might prefetch + bytes from outside of valid memory. This is particularly + dangerous in I/O space. */ + + ;; FIXME: It would be more space efficient to just branch to _memmove... + + cmp #0, r3 ; If the count is zero, do nothing + beq 1f + + mov r1, r14 ; Save a copy of DEST + +2: mov.b [r2+], r5 + mov.b r5, [r14+] + sub #1, r3 + bne 2b + +1: rts +#else mov r1, r4 ; Save a copy of DEST smovf ; Copy R2 (source) to R1 (dest). Stop after R3 bytes. mov r4, r1 ; Return DEST rts +#endif + .size _memcpy, . - _memcpy diff --git a/newlib/libc/machine/rx/memmove.S b/newlib/libc/machine/rx/memmove.S index 4b126bafc..60b76836b 100644 --- a/newlib/libc/machine/rx/memmove.S +++ b/newlib/libc/machine/rx/memmove.S @@ -4,6 +4,39 @@ .global _memmove .type _memmove,@function _memmove: + ;; R1: DEST + ;; R2: SRC + ;; R3: COUNT +#ifdef __RX_DISALLOW_STRING_INSNS__ + /* Do not use the string instructions - they might prefetch + bytes from outside of valid memory. This is particularly + dangerous in I/O space. */ + + cmp #0, r3 ; If the count is zero, do nothing + beq 4f + + cmp r1, r2 + blt 3f ; If SRC < DEST copy backwards + + mov r1, r14 ; Save a copy of DEST + +5: mov.b [r2+], r5 + mov.b r5, [r14+] + sub #1, r3 + bne 5b + +4: rts + +3: add r3, r1 + add r3, r2 + +6: mov.b [-r2], r5 + mov.b r5, [-r1] + sub #1, r3 + bne 6b + + rts +#else mov r1, r4 ; Save a copy of DEST cmp r1, r2 blt 2f ; If SRC (r2) is less than DEST (r1) then copy backwards @@ -18,3 +51,7 @@ _memmove: sub #1, r1 ; additions and subtractions. smovb bra 1b + +#endif /* SMOVF allowed. */ + + .size _memmove, . - _memmove diff --git a/newlib/libc/machine/rx/mempcpy.S b/newlib/libc/machine/rx/mempcpy.S index c679d04ce..f82452462 100644 --- a/newlib/libc/machine/rx/mempcpy.S +++ b/newlib/libc/machine/rx/mempcpy.S @@ -4,5 +4,22 @@ .global _mempcpy .type _mempcpy,@function _mempcpy: +#ifdef __RX_DISALLOW_STRING_INSNS__ + /* Do not use the string instructions - they might prefetch + bytes from outside of valid memory. This is particularly + dangerous in I/O space. */ + + cmp #0, r3 ; If the count is zero, do nothing + beq 2f + +1: mov.b [r2+], r5 + mov.b r5, [r1+] + sub #1, r3 + bne 1b + +2: rts +#else smovf rts +#endif + .size _mempcpy, . - _mempcpy diff --git a/newlib/libc/machine/rx/memset.S b/newlib/libc/machine/rx/memset.S index edab44620..5ce7a3bca 100644 --- a/newlib/libc/machine/rx/memset.S +++ b/newlib/libc/machine/rx/memset.S @@ -8,3 +8,6 @@ _memset: sstr.b mov r4, r1 rts + + .size _memset, . - _memset + diff --git a/newlib/libc/machine/rx/strcat.S b/newlib/libc/machine/rx/strcat.S index 7ceffb744..22533fc8d 100644 --- a/newlib/libc/machine/rx/strcat.S +++ b/newlib/libc/machine/rx/strcat.S @@ -6,6 +6,22 @@ _strcat: ;; On entry: r1 => Destination ;; r2 => Source +#ifdef __RX_DISALLOW_STRING_INSNS__ + mov r1, r4 ; Save a copy of the dest pointer. + +1: mov.b [r4+], r5 ; Find the NUL byte at the end of R4. + cmp #0, r5 + bne 1b + + sub #1, r4 ; Move R4 back to point at the NUL byte. + +2: mov.b [r2+], r5 ; Copy bytes from R2 to R4 until we reach a NUL byte. + mov.b r5, [r4+] + cmp #0, r5 + bne 2b + + rts +#else mov r1, r4 ; Save a copy of the dest pointer. mov r2, r5 ; Save a copy of the source pointer. @@ -20,3 +36,6 @@ _strcat: mov r4, r1 ; Return the original dest pointer. rts +#endif + .size _strcat, . - _strcat + diff --git a/newlib/libc/machine/rx/strcmp.S b/newlib/libc/machine/rx/strcmp.S index 397415bb4..6a06e6c9d 100644 --- a/newlib/libc/machine/rx/strcmp.S +++ b/newlib/libc/machine/rx/strcmp.S @@ -5,6 +5,21 @@ .global _strcmp .type _strcmp,@function _strcmp: +#ifdef __RX_DISALLOW_STRING_INSNS__ +2: mov.b [r1+], r4 + mov.b [r2+], r5 + cmp #0, r4 + beq 3f + cmp #0, r5 + beq 3f + cmp r4, r5 + beq 2b + +3: and #0xff, r4 ; We need to perform an unsigned comparison of the bytes. + and #0xff, r5 + sub r5, r4, r1 + rts +#else mov #-1, r3 ; Strictly speaking this is incorrect, but I doubt if anyone will ever know. scmpu ; Perform the string comparison bnc 1f ; If Carry is not set skip over @@ -13,3 +28,6 @@ _strcmp: 1: ; mov #-1,r1 ; Carry not set, result should be negative rts ; +#endif + .size _strcmp, . - _strcmp + diff --git a/newlib/libc/machine/rx/strcpy.S b/newlib/libc/machine/rx/strcpy.S index a2dc17464..05766ccef 100644 --- a/newlib/libc/machine/rx/strcpy.S +++ b/newlib/libc/machine/rx/strcpy.S @@ -4,8 +4,22 @@ .global _strcpy .type _strcpy,@function _strcpy: + ;; R1: dest + ;; R2: source +#ifdef __RX_DISALLOW_STRING_INSNS__ + mov r1, r4 ; Leave the destination address unchanged in the result register. + +1: mov.b [r2+], r5 + mov.b r5, [r4+] + cmp #0, r5 + bne 1b + + rts +#else mov r1, r4 mov #-1, r3 ; Strictly speaking this is incorrect, but I doubt if anyone will ever know. smovu mov r4, r1 rts +#endif + .size _strcpy, . - _strcpy diff --git a/newlib/libc/machine/rx/strlen.S b/newlib/libc/machine/rx/strlen.S index c07b429b2..bf12c0ce1 100644 --- a/newlib/libc/machine/rx/strlen.S +++ b/newlib/libc/machine/rx/strlen.S @@ -5,6 +5,17 @@ .global _strlen .type _strlen,@function _strlen: +#ifdef __RX_DISALLOW_STRING_INSNS__ + mov r1, r4 + +1: mov.b [r1+], r5 + cmp #0, r5 + bne 1b + + sub #1, r1 + sub r4, r1 + rts +#else add #0, r1, r4 ; Save a copy of the string start address and set the condition flags. beq null_string ; Test for a NULL pointer. mov #-1, r3 ; Set a limit on the number of bytes examined. @@ -14,3 +25,5 @@ _strlen: null_string: sub r4, r1 ; Compute the length. rts +#endif + .size _strlen, . - _strlen diff --git a/newlib/libc/machine/rx/strncat.S b/newlib/libc/machine/rx/strncat.S index 3bc6b75ae..ba544a43a 100644 --- a/newlib/libc/machine/rx/strncat.S +++ b/newlib/libc/machine/rx/strncat.S @@ -7,7 +7,27 @@ _strncat: ;; On entry: r1 => Destination ;; r2 => Source ;; r3 => Max number of bytes to copy +#ifdef __RX_DISALLOW_STRING_INSNS__ + cmp #0, r3 ; If max is zero we have nothing to do. + beq 2f + mov r1, r4 ; Leave the desintation pointer intact for the return value. + +1: mov.b [r4+], r5 ; Find the NUL byte at the end of the destination. + cmp #0, r5 + bne 1b + + sub #1, r4 + +3: mov.b [r2+], r5 ; Copy bytes from the source into the destination ... + mov.b r5, [r4+] + cmp #0, r5 ; ... until we reach a NUL byte ... + beq 2f + sub #1, r3 + bne 3b ; ... or we have copied N bytes. + +2: rts +#else mov r1, r4 ; Save a copy of the dest pointer. mov r2, r5 ; Save a copy of the source pointer. mov r3, r14 ; Save a copy of the byte count. @@ -33,3 +53,6 @@ _strncat: 1: mov r4, r1 ; Return the original dest pointer. rts +#endif + .size _strncat, . - _strncat + diff --git a/newlib/libc/machine/rx/strncmp.S b/newlib/libc/machine/rx/strncmp.S index 929e9cb0a..4be8076db 100644 --- a/newlib/libc/machine/rx/strncmp.S +++ b/newlib/libc/machine/rx/strncmp.S @@ -4,6 +4,32 @@ .global _strncmp .type _strncmp,@function _strncmp: + ;; R1: string1 + ;; R2: string2 + ;; R3: max number of bytes to compare +#ifdef __RX_DISALLOW_STRING_INSNS__ + cmp #0, r3 ; For a length of zero, return zero + beq 4f + +2: mov.b [r1+], r4 + mov.b [r2+], r5 + cmp #0, r4 + beq 3f + cmp #0, r5 + beq 3f + sub #1, r3 + beq 3f + cmp r4, r5 + beq 2b + +3: and #0xff, r4 ; We need to perform an unsigned comparison of the bytes. + and #0xff, r5 + sub r5, r4, r1 + rts + +4: mov #0, r1 + rts +#else scmpu ; Perform the string comparison bnc 1f ; If Carry is not set skip over scne.L r1 ; Set result based on Z flag @@ -11,3 +37,5 @@ _strncmp: 1: ; mov #-1,r1 ; Carry not set, result should be negative rts ; +#endif + .size _strncmp, . - _strncmp diff --git a/newlib/libc/machine/rx/strncpy.S b/newlib/libc/machine/rx/strncpy.S index e04922a59..e5b6a83ac 100644 --- a/newlib/libc/machine/rx/strncpy.S +++ b/newlib/libc/machine/rx/strncpy.S @@ -4,6 +4,26 @@ .global _strncpy .type _strncpy,@function _strncpy: +#ifdef __RX_DISALLOW_STRING_INSNS__ + cmp #0, r3 + beq 3f + + mov r1, r4 ; Preserve R1 for the return value. + +2: mov.b [r2+], r5 ; Copy bytes until... + mov.b r5, [r4+] + sub #1, r3 + beq 3f ; ... our count reaches zero + cmp #0, r5 + bne 2b ; ... or we have written a NUL byte + +4: mov.b r5, [r4+] ; Continue to write further NUL bytes + sub #1, r3 + bne 4b ; until the count reaches zero. + +3: rts + +#else mov r1, r4 ; Save a copy of the dest pointer. mov r3, r5 ; Save a copy of the byte count smovu ; Copy the bytes @@ -16,3 +36,6 @@ _strncpy: 1: mov r4, r1 ; Return the destination pointer rts +#endif + .size _strncpy, . - _strncpy + From aadd5f029569350d590cff33c7a3c643601fd5db Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 9 Apr 2015 21:49:36 +0200 Subject: [PATCH 049/109] Call open_null to open fake handle * fhandler_dsp.cc (fhandler_dev_dsp::open): Call open_null. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/fhandler_dsp.cc | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 2c170b4fc..6b8bd5663 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2015-04-09 Corinna Vinschen + + * fhandler_dsp.cc (fhandler_dev_dsp::open): Call open_null. + 2015-04-08 Corinna Vinschen * pwdgrp.h (sidfromuid): New inline function. diff --git a/winsup/cygwin/fhandler_dsp.cc b/winsup/cygwin/fhandler_dsp.cc index b5eaba7be..9fa2c6e03 100644 --- a/winsup/cygwin/fhandler_dsp.cc +++ b/winsup/cygwin/fhandler_dsp.cc @@ -1037,7 +1037,7 @@ fhandler_dev_dsp::fixup_after_exec () int -fhandler_dev_dsp::open (int flags, mode_t mode) +fhandler_dev_dsp::open (int flags, mode_t) { int ret = 0, err = 0; UINT num_in = 0, num_out = 0; @@ -1068,7 +1068,7 @@ fhandler_dev_dsp::open (int flags, mode_t mode) if (err) set_errno (err); else - ret = fhandler_base::open (flags, mode); + ret = open_null (flags); debug_printf ("ACCMODE=%y audio_in=%d audio_out=%d, err=%d, ret=%d", flags & O_ACCMODE, num_in, num_out, err, ret); From a44e09fd49296664c6ced76bae5cc70b3063e3e9 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 10 Apr 2015 11:25:40 +0200 Subject: [PATCH 050/109] First cut of full implementation of new permission handling * fhandler.cc (fhandler_base::open_with_arch): Call open with mode not umasked. (fhandler_base::open): Explicitely umask mode on NFS here. Call new set_created_file_access rather than set_file_attribute. * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Reimplement setting permissions on filesystems supporting ACLs using the new set_posix_access call. (fhandler_disk_file::fchown): Ditto. (fhandler_disk_file::mkdir): Call new set_created_file_access rather than set_file_attribute. * fhandler_socket.cc (fhandler_socket::bind): Don't umask here. Add WRITE_OWNER access to allow writing group in case of SGID bit set. Call new set_created_file_access rather than set_file_attribute. * path.cc (symlink_worker): Call new set_created_file_access rather than set_file_attribute. * sec_acl.cc (searchace): Un-staticize. (set_posix_access): New, complementary functionality to get_posix_access. (setacl): Implement in terms of get_posix_access/set_posix_access. (get_posix_access): Add handling for just created files requiring their first Cygwin ACL. Fix new_style recognition. Handle SGID bit. For old-style ACLs, ignore SYSTEM and Administrators when computing the {DEF_}CLASS_OBJ perms. * security.cc (get_file_sd): Revamp comment. Change and (hopefully) speed up inheritance processing for just created files. (alloc_sd): Remove. (set_security_attribute): Call set_posix_access instead of alloc_sd. (get_object_attribute): Fix return value. (create_object_sd_from_attribute): Call set_posix_access instead of alloc_sd. (set_file_attribute): Remove. (set_created_file_access): New function implemented in terms of get_posix_access/set_posix_access. * security.h (set_file_attribute): Remove prototype. (set_created_file_access): Add prototype. (searchace): Ditto. (set_posix_access): Ditto. * syscalls.cc (open): Call open_with_arch with mode not umasked. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 41 ++ winsup/cygwin/fhandler.cc | 9 +- winsup/cygwin/fhandler_disk_file.cc | 157 +++++--- winsup/cygwin/fhandler_socket.cc | 13 +- winsup/cygwin/path.cc | 7 +- winsup/cygwin/release/1.7.36 | 18 + winsup/cygwin/sec_acl.cc | 571 ++++++++++++++++------------ winsup/cygwin/security.cc | 544 ++++++-------------------- winsup/cygwin/security.h | 6 +- winsup/cygwin/syscalls.cc | 3 +- 10 files changed, 638 insertions(+), 731 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 6b8bd5663..e53ff94db 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,44 @@ +2015-04-10 Corinna Vinschen + + * fhandler.cc (fhandler_base::open_with_arch): Call open with mode + not umasked. + (fhandler_base::open): Explicitely umask mode on NFS here. Call new + set_created_file_access rather than set_file_attribute. + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Reimplement + setting permissions on filesystems supporting ACLs using the new + set_posix_access call. + (fhandler_disk_file::fchown): Ditto. + (fhandler_disk_file::mkdir): Call new set_created_file_access rather + than set_file_attribute. + * fhandler_socket.cc (fhandler_socket::bind): Don't umask here. Add + WRITE_OWNER access to allow writing group in case of SGID bit set. + Call new set_created_file_access rather than set_file_attribute. + * path.cc (symlink_worker): Call new set_created_file_access rather + than set_file_attribute. + * sec_acl.cc (searchace): Un-staticize. + (set_posix_access): New, complementary functionality to + get_posix_access. + (setacl): Implement in terms of get_posix_access/set_posix_access. + (get_posix_access): Add handling for just created files requiring + their first Cygwin ACL. Fix new_style recognition. Handle SGID + bit. For old-style ACLs, ignore SYSTEM and Administrators when + computing the {DEF_}CLASS_OBJ perms. + * security.cc (get_file_sd): Revamp comment. Change and (hopefully) + speed up inheritance processing for just created files. + (alloc_sd): Remove. + (set_security_attribute): Call set_posix_access instead of alloc_sd. + (get_object_attribute): Fix return value. + (create_object_sd_from_attribute): Call set_posix_access instead of + alloc_sd. + (set_file_attribute): Remove. + (set_created_file_access): New function implemented in terms of + get_posix_access/set_posix_access. + * security.h (set_file_attribute): Remove prototype. + (set_created_file_access): Add prototype. + (searchace): Ditto. + (set_posix_access): Ditto. + * syscalls.cc (open): Call open_with_arch with mode not umasked. + 2015-04-09 Corinna Vinschen * fhandler_dsp.cc (fhandler_dev_dsp::open): Call open_null. diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 6f024da32..4c1bdbaf1 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -463,7 +463,7 @@ fhandler_base::open_with_arch (int flags, mode_t mode) { int res; if (!(res = (archetype && archetype->io_handle) - || open (flags, (mode & 07777) & ~cygheap->umask))) + || open (flags, mode & 07777))) { if (archetype) delete archetype; @@ -662,9 +662,10 @@ fhandler_base::open (int flags, mode_t mode) + p->EaNameLength + 1); memset (nfs_attr, 0, sizeof (fattr3)); nfs_attr->type = NF3REG; - nfs_attr->mode = mode; + nfs_attr->mode = (mode & 07777) & ~cygheap->umask; } - else if (!has_acls () && !(mode & (S_IWUSR | S_IWGRP | S_IWOTH))) + else if (!has_acls () + && !(mode & ~cygheap->umask & (S_IWUSR | S_IWGRP | S_IWOTH))) /* If mode has no write bits set, and ACLs are not used, we set the DOS R/O attribute. */ file_attributes |= FILE_ATTRIBUTE_READONLY; @@ -716,7 +717,7 @@ fhandler_base::open (int flags, mode_t mode) This is the result of a discussion on the samba-technical list, starting at http://lists.samba.org/archive/samba-technical/2008-July/060247.html */ if (io.Information == FILE_CREATED && has_acls ()) - set_file_attribute (fh, pc, ILLEGAL_UID, ILLEGAL_GID, S_JUSTCREATED | mode); + set_created_file_access (fh, pc, mode); /* If you O_TRUNC a file on Linux, the data is truncated, but the EAs are preserved. If you open a file on Windows with FILE_OVERWRITE{_IF} or diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index f5edb03de..abc4b4134 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -835,7 +835,7 @@ int __reg1 fhandler_disk_file::fchmod (mode_t mode) { extern int chmod_device (path_conv& pc, mode_t mode); - int res = -1; + int ret = -1; int oret = 0; NTSTATUS status; IO_STATUS_BLOCK io; @@ -882,17 +882,42 @@ fhandler_disk_file::fchmod (mode_t mode) if (!NT_SUCCESS (status)) __seterrno_from_nt_status (status); else - res = 0; + ret = 0; goto out; } if (pc.has_acls ()) { - if (pc.isdir ()) - mode |= S_IFDIR; - if (!set_file_attribute (get_handle (), pc, - ILLEGAL_UID, ILLEGAL_GID, mode)) - res = 0; + security_descriptor sd, sd_ret; + uid_t uid; + gid_t gid; + tmp_pathbuf tp; + aclent_t *aclp; + int nentries, idx; + + if (!get_file_sd (get_handle (), pc, sd, false)) + { + aclp = (aclent_t *) tp.c_get (); + if ((nentries = get_posix_access (sd, NULL, &uid, &gid, + aclp, MAX_ACL_ENTRIES)) >= 0) + { + /* Overwrite ACL permissions as required by POSIX 1003.1e + draft 17. */ + aclp[0].a_perm = (mode >> 6) & S_IRWXO; + if (nentries > MIN_ACL_ENTRIES + && (idx = searchace (aclp, nentries, CLASS_OBJ)) >= 0) + aclp[idx].a_perm = (mode >> 6) & S_IRWXO; + else + aclp[1].a_perm = (mode >> 6) & S_IRWXO; + if ((idx = searchace (aclp, nentries, OTHER_OBJ)) >= 0) + aclp[idx].a_perm = mode & S_IRWXO; + if (pc.isdir ()) + mode |= S_IFDIR; + if (set_posix_access (mode, uid, gid, aclp, nentries, sd_ret, + pc.fs_is_samba ())) + ret = set_file_sd (get_handle (), pc, sd_ret, false); + } + } } /* If the mode has any write bits set, the DOS R/O flag is in the way. */ @@ -929,20 +954,28 @@ fhandler_disk_file::fchmod (mode_t mode) if (!NT_SUCCESS (status)) __seterrno_from_nt_status (status); else - res = 0; + ret = 0; } out: if (oret) close_fs (); - return res; + return ret; } int __reg2 fhandler_disk_file::fchown (uid_t uid, gid_t gid) { int oret = 0; + int ret = -1; + security_descriptor sd, sd_ret; + mode_t attr = pc.isdir () ? S_IFDIR : 0; + uid_t old_uid; + gid_t old_gid; + tmp_pathbuf tp; + aclent_t *aclp; + int nentries; if (!pc.has_acls ()) { @@ -959,52 +992,71 @@ fhandler_disk_file::fchown (uid_t uid, gid_t gid) return -1; } - mode_t attrib = 0; - if (pc.isdir ()) - attrib |= S_IFDIR; - uid_t old_uid; - int res = get_file_attribute (get_handle (), pc, &attrib, &old_uid, NULL); - if (!res) - { - /* Typical Windows default ACLs can contain permissions for one - group, while being owned by another user/group. The permission - bits returned above are pretty much useless then. Creating a - new ACL with these useless permissions results in a potentially - broken symlink. So what we do here is to set the underlying - permissions of symlinks to a sensible value which allows the - world to read the symlink and only the new owner to change it. */ - if (pc.issymlink ()) - attrib = S_IFLNK | STD_RBITS | STD_WBITS; - res = set_file_attribute (get_handle (), pc, uid, gid, attrib); - /* If you're running a Samba server which has no winbind running, the - uid<->SID mapping is disfunctional. Even trying to chown to your - own account fails since the account used on the server is the UNIX - account which gets used for the standard user mapping. This is a - default mechanism which doesn't know your real Windows SID. - There are two possible error codes in different Samba releases for - this situation, one of them is unfortunately the not very significant - STATUS_ACCESS_DENIED. Instead of relying on the error codes, we're - using the below very simple heuristic. If set_file_attribute failed, - and the original user account was either already unknown, or one of - the standard UNIX accounts, we're faking success. */ - if (res == -1 && pc.fs_is_samba ()) - { - PSID sid; + if (get_file_sd (get_handle (), pc, sd, false)) + goto out; - if (old_uid == ILLEGAL_UID - || ((sid = sidfromuid (old_uid, NULL)) != NO_SID - && RtlEqualPrefixSid (sid, - well_known_samba_unix_user_fake_sid))) - { - debug_printf ("Faking chown worked on standalone Samba"); - res = 0; - } + aclp = (aclent_t *) tp.c_get (); + if ((nentries = get_posix_access (sd, &attr, &old_uid, &old_gid, + aclp, MAX_ACL_ENTRIES)) < 0) + goto out; + + if (uid == ILLEGAL_UID) + uid = old_uid; + if (gid == ILLEGAL_GID) + gid = old_gid; + if (uid == old_uid && gid == old_gid) + { + ret = 0; + goto out; + } + + /* Windows ACLs can contain permissions for one group, while being owned by + another user/group. The permission bits returned above are pretty much + useless then. Creating a new ACL with these useless permissions results + in a potentially broken symlink. So what we do here is to set the + underlying permissions of symlinks to a sensible value which allows the + world to read the symlink and only the new owner to change it. */ + if (pc.issymlink ()) + for (int idx = 0; idx < nentries; ++idx) + { + aclp[idx].a_perm |= S_IROTH; + if (aclp[idx].a_type & USER_OBJ) + aclp[idx].a_perm |= S_IWOTH; + } + + if (set_posix_access (attr, uid, gid, aclp, nentries, sd_ret, + pc.fs_is_samba ())) + ret = set_file_sd (get_handle (), pc, sd_ret, true); + + /* If you're running a Samba server with no winbind, the uid<->SID mapping + is disfunctional. Even trying to chown to your own account fails since + the account used on the server is the UNIX account which gets used for + the standard user mapping. This is a default mechanism which doesn't + know your real Windows SID. There are two possible error codes in + different Samba releases for this situation, one of them unfortunately + the not very significant STATUS_ACCESS_DENIED. Instead of relying on + the error codes, we're using the below very simple heuristic. + If set_file_sd failed, and the original user account was either already + unknown, or one of the standard UNIX accounts, we're faking success. */ + if (ret == -1 && pc.fs_is_samba ()) + { + PSID sid; + + if (uid == old_uid + || ((sid = sidfromuid (old_uid, NULL)) != NO_SID + && RtlEqualPrefixSid (sid, + well_known_samba_unix_user_fake_sid))) + { + debug_printf ("Faking chown worked on standalone Samba"); + ret = 0; } } + +out: if (oret) close_fs (); - return res; + return ret; } int __reg3 @@ -1763,10 +1815,11 @@ fhandler_disk_file::mkdir (mode_t mode) p, plen); if (NT_SUCCESS (status)) { + /* Set the "directory attribute" so that pc.isdir() returns correct + value in subsequent function calls. */ + pc.file_attributes (FILE_ATTRIBUTE_DIRECTORY); if (has_acls ()) - set_file_attribute (dir, pc, ILLEGAL_UID, ILLEGAL_GID, - S_JUSTCREATED | S_IFDIR - | ((mode & 07777) & ~cygheap->umask)); + set_created_file_access (dir, pc, mode & 07777); NtClose (dir); res = 0; } diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 1b28e5220..e441fd18c 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -1,7 +1,7 @@ /* fhandler_socket.cc. See fhandler.h for a description of the fhandler classes. Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, - 2011, 2012, 2013, 2014 Red Hat, Inc. + 2011, 2012, 2013, 2014, 2015 Red Hat, Inc. This file is part of Cygwin. @@ -1039,10 +1039,10 @@ fhandler_socket::bind (const struct sockaddr *name, int namelen) sin.sin_port = ntohs (sin.sin_port); debug_printf ("AF_LOCAL: socket bound to port %u", sin.sin_port); - mode_t mode = adjust_socket_file_mode ((S_IRWXU | S_IRWXG | S_IRWXO) - & ~cygheap->umask); + mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; DWORD fattr = FILE_ATTRIBUTE_SYSTEM; - if (!(mode & (S_IWUSR | S_IWGRP | S_IWOTH)) && !pc.has_acls ()) + if (!pc.has_acls () + && !(mode & ~cygheap->umask & (S_IWUSR | S_IWGRP | S_IWOTH))) fattr |= FILE_ATTRIBUTE_READONLY; SECURITY_ATTRIBUTES sa = sec_none_nih; NTSTATUS status; @@ -1060,7 +1060,7 @@ fhandler_socket::bind (const struct sockaddr *name, int namelen) I don't know what setting that is or how to recognize such a share, so for now we don't request WRITE_DAC on remote drives. */ if (pc.has_acls () && !pc.isremote ()) - access |= READ_CONTROL | WRITE_DAC; + access |= READ_CONTROL | WRITE_DAC | WRITE_OWNER; status = NtCreateFile (&fh, access, pc.get_object_attr (attr, sa), &io, NULL, fattr, 0, FILE_CREATE, @@ -1078,8 +1078,7 @@ fhandler_socket::bind (const struct sockaddr *name, int namelen) else { if (pc.has_acls ()) - set_file_attribute (fh, pc, ILLEGAL_UID, ILLEGAL_GID, - S_JUSTCREATED | mode); + set_created_file_access (fh, pc, mode); char buf[sizeof (SOCKET_COOKIE) + 80]; __small_sprintf (buf, "%s%u %c ", SOCKET_COOKIE, sin.sin_port, get_socket_type () == SOCK_STREAM ? 's' diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index b05333fd7..5439a161a 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2037,10 +2037,9 @@ symlink_worker (const char *oldpath, const char *newpath, bool isdevice) __seterrno_from_nt_status (status); __leave; } - if (win32_newpath.has_acls ()) - set_file_attribute (fh, win32_newpath, ILLEGAL_UID, ILLEGAL_GID, - (io.Information == FILE_CREATED ? S_JUSTCREATED : 0) - | S_IFLNK | STD_RBITS | STD_WBITS); + if (io.Information == FILE_CREATED && win32_newpath.has_acls ()) + set_created_file_access (fh, win32_newpath, + S_IFLNK | STD_RBITS | STD_WBITS); status = NtWriteFile (fh, NULL, NULL, NULL, &io, buf, cp - buf, NULL, NULL); if (NT_SUCCESS (status) && io.Information == (ULONG) (cp - buf)) diff --git a/winsup/cygwin/release/1.7.36 b/winsup/cygwin/release/1.7.36 index f01e497fe..c9fdd8510 100644 --- a/winsup/cygwin/release/1.7.36 +++ b/winsup/cygwin/release/1.7.36 @@ -1,6 +1,24 @@ What's new: ----------- +- New, unified implementation of POSIX permission and ACL handling. The + new ACLs now store the POSIX ACL MASK/CLASS_OBJ permission mask, and + they allow to inherit the S_ISGID bit. ACL inheritance now really + works as desired, in a limited, but theoretically equivalent fashion + even for non-Cygwin processes. + + To accommodate Windows default ACLs, the new code ignores SYSTEM and + Administrators group permissions when computing the MASK/CLASS_OBJ + permission mask on old ACLs, and it doesn't deny access to SYSTEM and + Administrators group based on the value of MASK/CLASS_OBJ when + creating the new ACLs. + + The new code now handles the S_ISGID bit on directories as on Linux: + Setting S_ISGID on a directory causes new files and subdirs created + within to inherit its group, rather than the primary group of the user + who created the file. This only works for files and directories + created by Cygwin processes. + - basename(3) now comes in two flavors, POSIX and GNU. The POSIX version is the default. You get the GNU version after diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 55ff1bea7..628b22146 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -91,8 +91,8 @@ details. */ | CYG_ACE_MASK_VALID) #define CYG_ACE_NEW_STYLE READ_CONTROL /* New style if set. */ -static int -searchace (aclent_t *aclp, int nentries, int type, uid_t id = ILLEGAL_UID) +int +searchace (aclent_t *aclp, int nentries, int type, uid_t id) { int i; @@ -103,265 +103,276 @@ searchace (aclent_t *aclp, int nentries, int type, uid_t id = ILLEGAL_UID) return -1; } -/* This function *requires* an acl list sorted with aclsort{32}. */ -int -setacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp, - bool &writable) +/* Define own bit masks rather than using the GENERIC masks. The latter + also contain standard rights, which we don't need here. */ +#define FILE_ALLOW_READ (FILE_READ_DATA | FILE_READ_ATTRIBUTES | \ + FILE_READ_EA) +#define FILE_DENY_READ (FILE_READ_DATA | FILE_READ_EA) +#define FILE_ALLOW_WRITE (FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | \ + FILE_WRITE_EA | FILE_APPEND_DATA) +#define FILE_DENY_WRITE FILE_ALLOW_WRITE | FILE_DELETE_CHILD +#define FILE_DENY_WRITE_OWNER (FILE_WRITE_DATA | FILE_WRITE_EA | \ + FILE_APPEND_DATA | FILE_DELETE_CHILD) +#define FILE_ALLOW_EXEC (FILE_EXECUTE) +#define FILE_DENY_EXEC FILE_ALLOW_EXEC + +#define STD_RIGHTS_OTHER (STANDARD_RIGHTS_READ | SYNCHRONIZE) +#define STD_RIGHTS_OWNER (STANDARD_RIGHTS_ALL | SYNCHRONIZE) + +/* From the attributes and the POSIX ACL list, compute a new-style Cygwin + security descriptor. The function returns a pointer to the + SECURITY_DESCRIPTOR in sd_ret, or NULL if the function fails. + + This function *requires* a verified and sorted acl list! */ +PSECURITY_DESCRIPTOR +set_posix_access (mode_t attr, uid_t uid, gid_t gid, + aclent_t *aclbufp, int nentries, + security_descriptor &sd_ret, + bool is_samba) { - security_descriptor sd_ret; - tmp_pathbuf tp; - - if (get_file_sd (handle, pc, sd_ret, false)) - return -1; - + SECURITY_DESCRIPTOR sd; + cyg_ldap cldap; + PSID owner, group; NTSTATUS status; + tmp_pathbuf tp; + cygpsid *aclsid; PACL acl; - BOOLEAN acl_exists, dummy; - - /* Get owner SID. */ - PSID owner_sid; - status = RtlGetOwnerSecurityDescriptor (sd_ret, &owner_sid, &dummy); - if (!NT_SUCCESS (status)) - { - __seterrno_from_nt_status (status); - return -1; - } - cygsid owner (owner_sid); - - /* Get group SID. */ - PSID group_sid; - status = RtlGetGroupSecurityDescriptor (sd_ret, &group_sid, &dummy); - if (!NT_SUCCESS (status)) - { - __seterrno_from_nt_status (status); - return -1; - } - cygsid group (group_sid); - - /* Search for NULL ACE and store state of SUID, SGID and VTX bits. */ - DWORD null_mask = 0; - if (NT_SUCCESS (RtlGetDaclSecurityDescriptor (sd_ret, &acl_exists, &acl, - &dummy))) - for (USHORT i = 0; i < acl->AceCount; ++i) - { - ACCESS_ALLOWED_ACE *ace; - if (NT_SUCCESS (RtlGetAce (acl, i, (PVOID *) &ace))) - { - cygpsid ace_sid ((PSID) &ace->SidStart); - if (ace_sid == well_known_null_sid) - { - null_mask = ace->Mask; - break; - } - } - } + size_t acl_len = sizeof (ACL); + mode_t class_obj = 0, other_obj, group_obj, deny; + DWORD access; + int idx, start_idx, class_idx, tmp_idx; /* Initialize local security descriptor. */ - SECURITY_DESCRIPTOR sd; RtlCreateSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION); /* As in alloc_sd, set SE_DACL_PROTECTED to prevent the DACL from being modified by inheritable ACEs. */ RtlSetControlSecurityDescriptor (&sd, SE_DACL_PROTECTED, SE_DACL_PROTECTED); + /* Fetch owner and group and set in security descriptor. */ + owner = sidfromuid (uid, &cldap); + group = sidfromgid (gid, &cldap); status = RtlSetOwnerSecurityDescriptor (&sd, owner, FALSE); if (!NT_SUCCESS (status)) { __seterrno_from_nt_status (status); - return -1; + return NULL; } status = RtlSetGroupSecurityDescriptor (&sd, group, FALSE); if (!NT_SUCCESS (status)) { __seterrno_from_nt_status (status); - return -1; + return NULL; } - /* Fill access control list. */ + /* No POSIX ACL? Use attr to generate one from scratch. */ + if (!aclbufp) + { + aclbufp = (aclent_t *) tp.c_get (); + aclbufp[0].a_type = USER_OBJ; + aclbufp[0].a_id = ILLEGAL_UID; + aclbufp[0].a_perm = (attr >> 6) & S_IRWXO; + aclbufp[1].a_type = GROUP_OBJ; + aclbufp[1].a_id = ILLEGAL_GID; + aclbufp[1].a_perm = (attr >> 3) & S_IRWXO; + aclbufp[2].a_type = OTHER_OBJ; + aclbufp[2].a_id = ILLEGAL_GID; + aclbufp[2].a_perm = attr & S_IRWXO; + nentries = MIN_ACL_ENTRIES; + if (S_ISDIR (attr)) + { + aclbufp[3].a_type = DEF_USER_OBJ; + aclbufp[3].a_id = ILLEGAL_UID; + aclbufp[3].a_perm = (attr >> 6) & S_IRWXO; + aclbufp[4].a_type = GROUP_OBJ; + aclbufp[4].a_id = ILLEGAL_GID; + aclbufp[4].a_perm = (attr >> 3) & S_IRWXO; + aclbufp[5].a_type = OTHER_OBJ; + aclbufp[5].a_id = ILLEGAL_GID; + aclbufp[5].a_perm = attr & S_IRWXO; + nentries += MIN_ACL_ENTRIES; + } + } + + /* Collect SIDs of all entries in aclbufp. */ + aclsid = (cygpsid *) tp.w_get (); + for (idx = 0; idx < nentries; ++idx) + switch (aclbufp[idx].a_type & ~ACL_DEFAULT) + { + case USER_OBJ: + aclsid[idx] = (aclbufp[idx].a_type & ACL_DEFAULT) + ? (PSID) well_known_creator_owner_sid : owner; + break; + case USER: + aclsid[idx] = sidfromuid (aclbufp[idx].a_id, &cldap); + break; + case GROUP_OBJ: + aclsid[idx] = (aclbufp[idx].a_type & ACL_DEFAULT && !(attr & S_ISGID)) + ? (PSID) well_known_creator_group_sid : group; + break; + case GROUP: + aclsid[idx] = sidfromgid (aclbufp[idx].a_id, &cldap); + break; + case CLASS_OBJ: + aclsid[idx] = well_known_null_sid; + break; + case OTHER_OBJ: + aclsid[idx] = well_known_world_sid; + break; + } + + /* Initialize ACL. */ acl = (PACL) tp.w_get (); - size_t acl_len = sizeof (ACL); - - cygsid sid; - struct passwd *pw; - struct group *gr; - int pos; - cyg_ldap cldap; - RtlCreateAcl (acl, ACL_MAXIMUM_SIZE, ACL_REVISION); - writable = false; - - bool *invalid = (bool *) tp.c_get (); - memset (invalid, 0, nentries * sizeof *invalid); - - /* Pre-compute owner, group, and other permissions to allow creating - matching deny ACEs as in alloc_sd. */ - DWORD owner_allow = 0, group_allow = 0, other_allow = 0; - PDWORD allow; - for (int i = 0; i < nentries; ++i) + /* This loop has two runs, the first handling the actual permission, + the second handling the default permissions. */ + idx = 0; + for (int def = 0; def <= ACL_DEFAULT; def += ACL_DEFAULT) { - switch (aclbufp[i].a_type) - { - case USER_OBJ: - allow = &owner_allow; - *allow = STANDARD_RIGHTS_ALL - | (pc.fs_is_samba () ? 0 : FILE_WRITE_ATTRIBUTES); - break; - case GROUP_OBJ: - allow = &group_allow; - break; - case OTHER_OBJ: - allow = &other_allow; - break; - default: - continue; - } - *allow |= STANDARD_RIGHTS_READ | SYNCHRONIZE - | (pc.fs_is_samba () ? 0 : FILE_READ_ATTRIBUTES); - if (aclbufp[i].a_perm & S_IROTH) - *allow |= FILE_GENERIC_READ; - if (aclbufp[i].a_perm & S_IWOTH) - { - *allow |= FILE_GENERIC_WRITE; - writable = true; - } - if (aclbufp[i].a_perm & S_IXOTH) - *allow |= FILE_GENERIC_EXECUTE & ~FILE_READ_ATTRIBUTES; - /* Keep S_ISVTX rule in sync with alloc_sd. */ - if (pc.isdir () - && (aclbufp[i].a_perm & (S_IWOTH | S_IXOTH)) == (S_IWOTH | S_IXOTH) - && (aclbufp[i].a_type == USER_OBJ - || !(null_mask & FILE_READ_DATA))) - *allow |= FILE_DELETE_CHILD; - invalid[i] = true; - } - bool isownergroup = (owner == group); - DWORD owner_deny = ~owner_allow & (group_allow | other_allow); - owner_deny &= ~(STANDARD_RIGHTS_READ - | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES); - DWORD group_deny = ~group_allow & other_allow; - group_deny &= ~(STANDARD_RIGHTS_READ | FILE_READ_ATTRIBUTES); - - /* Set deny ACE for owner. */ - if (owner_deny - && !add_access_denied_ace (acl, owner_deny, owner, acl_len, - NO_INHERITANCE)) - return -1; - /* Set deny ACE for group here to respect the canonical order, - if this does not impact owner */ - if (group_deny && !(group_deny & owner_allow) && !isownergroup - && !add_access_denied_ace (acl, group_deny, group, acl_len, - NO_INHERITANCE)) - return -1; - /* Set allow ACE for owner. */ - if (!add_access_allowed_ace (acl, owner_allow, owner, acl_len, - NO_INHERITANCE)) - return -1; - /* Set deny ACE for group, if still needed. */ - if (group_deny & owner_allow && !isownergroup - && !add_access_denied_ace (acl, group_deny, group, acl_len, - NO_INHERITANCE)) - return -1; - /* Set allow ACE for group. */ - if (!isownergroup - && !add_access_allowed_ace (acl, group_allow, group, acl_len, - NO_INHERITANCE)) - return -1; - /* Set allow ACE for everyone. */ - if (!add_access_allowed_ace (acl, other_allow, well_known_world_sid, acl_len, - NO_INHERITANCE)) - return -1; - /* If a NULL ACE exists, copy it verbatim. */ - if (null_mask) - if (!add_access_allowed_ace (acl, null_mask, well_known_null_sid, acl_len, - NO_INHERITANCE)) - return -1; - for (int i = 0; i < nentries; ++i) - { - DWORD allow; - /* Skip invalidated entries. */ - if (invalid[i]) - continue; - - allow = STANDARD_RIGHTS_READ - | (pc.fs_is_samba () ? 0 : FILE_READ_ATTRIBUTES); - if (aclbufp[i].a_perm & S_IROTH) - allow |= FILE_GENERIC_READ; - if (aclbufp[i].a_perm & S_IWOTH) - { - allow |= FILE_GENERIC_WRITE; - writable = true; - } - if (aclbufp[i].a_perm & S_IXOTH) - allow |= FILE_GENERIC_EXECUTE & ~FILE_READ_ATTRIBUTES; - /* Keep S_ISVTX rule in sync with alloc_sd. */ - if (pc.isdir () - && (aclbufp[i].a_perm & (S_IWOTH | S_IXOTH)) == (S_IWOTH | S_IXOTH) - && !(null_mask & FILE_READ_DATA)) - allow |= FILE_DELETE_CHILD; - /* Set inherit property. */ - DWORD inheritance = (aclbufp[i].a_type & ACL_DEFAULT) - ? (SUB_CONTAINERS_AND_OBJECTS_INHERIT | INHERIT_ONLY) + DWORD inherit = def ? SUB_CONTAINERS_AND_OBJECTS_INHERIT | INHERIT_ONLY : NO_INHERITANCE; - /* - * If a specific acl contains a corresponding default entry with - * identical permissions, only one Windows ACE with proper - * inheritance bits is created. - */ - if (!(aclbufp[i].a_type & ACL_DEFAULT) - && aclbufp[i].a_type & (USER|GROUP) - && (pos = searchace (aclbufp + i + 1, nentries - i - 1, - aclbufp[i].a_type | ACL_DEFAULT, - (aclbufp[i].a_type & (USER|GROUP)) - ? aclbufp[i].a_id : ILLEGAL_UID)) >= 0 - && aclbufp[i].a_perm == aclbufp[i + 1 + pos].a_perm) + + /* No default ACEs on files. */ + if (def && !S_ISDIR (attr)) { - inheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT; - /* invalidate the corresponding default entry. */ - invalid[i + 1 + pos] = true; + /* Trying to set default ACEs on a non-directory is an error. + The underlying functions on Linux return EACCES. */ + if (idx < nentries && aclbufp[idx].a_type & ACL_DEFAULT) + { + set_errno (EACCES); + return NULL; + } + break; } - switch (aclbufp[i].a_type) + + /* To compute deny access masks, we need group_obj, other_obj and... */ + tmp_idx = searchace (aclbufp, nentries, def | GROUP_OBJ); + /* No default entries present? */ + if (tmp_idx < 0) + break; + group_obj = aclbufp[tmp_idx].a_perm; + tmp_idx = searchace (aclbufp, nentries, def | OTHER_OBJ); + other_obj = aclbufp[tmp_idx].a_perm; + + /* ... class_obj. Create Cygwin ACE. Only the S_ISGID attribute gets + inherited. */ + access = CYG_ACE_ISBITS_TO_WIN (def ? attr & S_ISGID : attr); + class_idx = searchace (aclbufp, nentries, def | CLASS_OBJ); + if (class_idx >= 0) { - case DEF_USER_OBJ: - allow |= STANDARD_RIGHTS_ALL - | (pc.fs_is_samba () ? 0 : FILE_WRITE_ATTRIBUTES); - if (!add_access_allowed_ace (acl, allow, well_known_creator_owner_sid, - acl_len, inheritance)) - return -1; - break; - case USER: - case DEF_USER: - if (!(pw = internal_getpwuid (aclbufp[i].a_id, &cldap)) - || !sid.getfrompw (pw)) - { - set_errno (EINVAL); - return -1; - } - if (!add_access_allowed_ace (acl, allow, sid, acl_len, inheritance)) - return -1; - break; - case DEF_GROUP_OBJ: - if (!add_access_allowed_ace (acl, allow, well_known_creator_group_sid, - acl_len, inheritance)) - return -1; - break; - case GROUP: - case DEF_GROUP: - if (!(gr = internal_getgrgid (aclbufp[i].a_id, &cldap)) - || !sid.getfromgr (gr)) - { - set_errno (EINVAL); - return -1; - } - if (!add_access_allowed_ace (acl, allow, sid, acl_len, inheritance)) - return -1; - break; - case DEF_OTHER_OBJ: - if (!add_access_allowed_ace (acl, allow, well_known_world_sid, - acl_len, inheritance)) - return -1; + class_obj = aclbufp[class_idx].a_perm; + access |= CYG_ACE_MASK_TO_WIN (class_obj); } + else + { + /* Setting class_obj to group_obj allows to write below code without + additional checks for existence of a CLASS_OBJ. */ + class_obj = group_obj; + class_idx = -1; + } + access |= CYG_ACE_NEW_STYLE; + if (!add_access_denied_ace (acl, access, well_known_null_sid, acl_len, + inherit)) + return NULL; + + /* This loop has two runs, the first w/ check_types == (USER_OBJ | USER), + the second w/ check_types == (GROUP_OBJ | GROUP). Each run creates + first the deny, then the allow ACEs for the current types. */ + for (int check_types = USER_OBJ | USER; + check_types < CLASS_OBJ; + check_types <<= 2) + { + /* Create deny ACEs for users, then groups. */ + for (start_idx = idx; + idx < nentries && aclbufp[idx].a_type & check_types; + ++idx) + { + /* For the rules how to construct the deny access mask, see the + comment right at the start of this file. */ + if (aclbufp[idx].a_type & USER_OBJ) + deny = ~aclbufp[idx].a_perm & (class_obj | other_obj); + else if (aclbufp[idx].a_type & USER) + deny = (aclbufp[idx].a_perm ^ class_obj) + | (~aclbufp[idx].a_perm & other_obj); + else + deny = (aclbufp[idx].a_perm & ~class_obj) + | (~aclbufp[idx].a_perm & other_obj); + if (!deny) + continue; + /* Accommodate Windows: Never generate deny masks for SYSTEM + and the Administrators group. */ + if (aclsid[idx] == well_known_system_sid + || aclsid[idx] == well_known_admins_sid) + continue; + access = 0; + if (deny & S_IROTH) + access |= FILE_DENY_READ; + if (deny & S_IWOTH) + access |= (aclbufp[idx].a_type & USER_OBJ) + ? FILE_DENY_WRITE_OWNER : FILE_DENY_WRITE; + if (deny & S_IXOTH) + access |= FILE_DENY_EXEC; + if (!add_access_denied_ace (acl, access, aclsid[idx], acl_len, + inherit)) + return NULL; + } + /* Create allow ACEs for users, then groups. */ + for (idx = start_idx; + idx < nentries && aclbufp[idx].a_type & check_types; + ++idx) + { + /* Don't set FILE_READ/WRITE_ATTRIBUTES unconditionally on Samba, + otherwise it enforces read permissions. */ + access = STD_RIGHTS_OTHER | (is_samba ? 0 : FILE_READ_ATTRIBUTES); + if (aclbufp[idx].a_type & USER_OBJ) + { + access |= STD_RIGHTS_OWNER; + if (!is_samba) + access |= FILE_WRITE_ATTRIBUTES; + /* Set FILE_DELETE_CHILD on files with "rwx" perms for the + owner so that the owner gets "full control" (Duh). */ + if (aclbufp[idx].a_perm == S_IRWXO) + access |= FILE_DELETE_CHILD; + } + if (aclbufp[idx].a_perm & S_IROTH) + access |= FILE_ALLOW_READ; + if (aclbufp[idx].a_perm & S_IWOTH) + access |= FILE_ALLOW_WRITE; + if (aclbufp[idx].a_perm & S_IXOTH) + access |= FILE_ALLOW_EXEC; + /* Handle S_ISVTX. */ + if (S_ISDIR (attr) + && (aclbufp[idx].a_perm & (S_IWOTH | S_IXOTH)) + == (S_IWOTH | S_IXOTH) + && (!(attr & S_ISVTX) || aclbufp[idx].a_type & USER_OBJ)) + access |= FILE_DELETE_CHILD; + if (!add_access_allowed_ace (acl, access, aclsid[idx], acl_len, + inherit)) + return NULL; + } + } + /* Create allow ACE for other. It's preceeded by class_obj if it exists. + If so, skip it. */ + if (aclbufp[idx].a_type & CLASS_OBJ) + ++idx; + access = STD_RIGHTS_OTHER | (is_samba ? 0 : FILE_READ_ATTRIBUTES); + if (aclbufp[idx].a_perm & S_IROTH) + access |= FILE_ALLOW_READ; + if (aclbufp[idx].a_perm & S_IWOTH) + access |= FILE_ALLOW_WRITE; + if (aclbufp[idx].a_perm & S_IXOTH) + access |= FILE_ALLOW_EXEC; + /* Handle S_ISVTX. */ + if (S_ISDIR (attr) + && (aclbufp[idx].a_perm & (S_IWOTH | S_IXOTH)) == (S_IWOTH | S_IXOTH) + && !(attr & S_ISVTX)) + access |= FILE_DELETE_CHILD; + if (!add_access_allowed_ace (acl, access, aclsid[idx++], acl_len, + inherit)) + return NULL; } + /* Set AclSize to computed value. */ acl->AclSize = acl_len; debug_printf ("ACL-Size: %u", acl_len); @@ -370,7 +381,7 @@ setacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp, if (!NT_SUCCESS (status)) { __seterrno_from_nt_status (status); - return -1; + return NULL; } /* Make self relative security descriptor in sd_ret. */ DWORD sd_size = 0; @@ -378,20 +389,43 @@ setacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp, if (sd_size <= 0) { __seterrno (); - return -1; + return NULL; } if (!sd_ret.realloc (sd_size)) { set_errno (ENOMEM); - return -1; + return NULL; } status = RtlAbsoluteToSelfRelativeSD (&sd, sd_ret, &sd_size); if (!NT_SUCCESS (status)) { __seterrno_from_nt_status (status); - return -1; + return NULL; } debug_printf ("Created SD-Size: %u", sd_ret.size ()); + return sd_ret; +} + +/* This function *requires* a verified and sorted acl list! */ +int +setacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp, + bool &writable) +{ + security_descriptor sd, sd_ret; + mode_t attr = pc.isdir () ? S_IFDIR : 0; + uid_t uid; + gid_t gid; + + if (get_file_sd (handle, pc, sd, false)) + return -1; + if (get_posix_access (sd, &attr, &uid, &gid, NULL, 0) < 0) + return -1; + if (!set_posix_access (attr, uid, gid, aclbufp, nentries, + sd_ret, pc.fs_is_samba ())) + return -1; + /* FIXME? Caller needs to know if any write perms are set to allow removing + the DOS R/O bit. */ + writable = true; return set_file_sd (handle, pc, sd_ret, false); } @@ -451,6 +485,8 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, tmp_pathbuf tp; NTSTATUS status; BOOLEAN dummy, acl_exists; + SECURITY_DESCRIPTOR_CONTROL ctrl; + ULONG rev; PACL acl; PACCESS_ALLOWED_ACE ace; cygpsid owner_sid, group_sid; @@ -462,9 +498,11 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, cygpsid ace_sid; int pos, type, id, idx; + bool just_created = false; bool new_style = false; bool saw_user_obj = false; bool saw_group_obj = false; + bool saw_other_obj = false; bool saw_def_group_obj = false; bool has_class_perm = false; bool has_def_class_perm = false; @@ -527,7 +565,10 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, uid = owner_sid.get_uid (&cldap); gid = group_sid.get_gid (&cldap); if (attr_ret) - attr |= (*attr_ret & S_IFMT); + { + attr = *attr_ret & S_IFMT; + just_created = *attr_ret & S_JUSTCREATED; + } /* Create and initialize local aclent_t array. */ lacl = (aclent_t *) tp.c_get (); @@ -547,7 +588,18 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, goto out; } - for (idx = 0; idx < acl->AceCount; ++idx) + /* Files and dirs are created with a NULL descriptor, so inheritence + rules kick in. If no inheritable entries exist in the parent object, + Windows will create entries according to the user token's default DACL. + These entries are not desired and we ignore them at creation time. + We're just checking the SE_DACL_AUTO_INHERITED flag here, since that's + what we set in get_file_sd. Read the longish comment there before + changing this test! */ + if (just_created + && NT_SUCCESS (RtlGetControlSecurityDescriptor (psd, &ctrl, &rev)) + && !(ctrl & SE_DACL_AUTO_INHERITED)) + ; + else for (idx = 0; idx < acl->AceCount; ++idx) { if (!NT_SUCCESS (RtlGetAce (acl, idx, (PVOID *) &ace))) continue; @@ -567,10 +619,10 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, USER, GROUP and GROUP_OBJ entries. Any ACL not created that way has been rearranged by the Windows functionality to create the brain-dead "canonical" ACL order and is broken anyway. */ + new_style = true; attr |= CYG_ACE_ISBITS_TO_POSIX (ace->Mask); if (ace->Mask & CYG_ACE_MASK_VALID) { - new_style = true; if (!(ace->Header.AceFlags & INHERIT_ONLY)) { if ((pos = searchace (lacl, MAX_ACL_ENTRIES, CLASS_OBJ)) @@ -613,6 +665,9 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, { type = OTHER_OBJ; id = ILLEGAL_GID; + if (ace->Header.AceType == ACCESS_ALLOWED_ACE_TYPE + && !(ace->Header.AceFlags & INHERIT_ONLY)) + saw_other_obj = true; } else if (ace_sid == well_known_creator_owner_sid) { @@ -632,6 +687,15 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, id = ace_sid.get_id (TRUE, &type, &cldap); if (!type) continue; + /* If the SGID attribute is set on a new-style Cygwin ACL on + a just created file or dir, the first group in the ACL is + the desired primary group of the new object. */ + if (just_created && new_style && attr & S_ISGID + && !saw_group_obj && type == GROUP) + { + type = GROUP_OBJ; + lacl[1].a_id = gid = id; + } } if (!(ace->Header.AceFlags & INHERIT_ONLY || type & ACL_DEFAULT)) { @@ -655,14 +719,18 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, if ((pos = searchace (lacl, MAX_ACL_ENTRIES, type, id)) >= 0) { getace (lacl[pos], type, id, ace->Mask, ace->Header.AceType, - new_style && type & (USER | GROUP)); + new_style && type & (USER | GROUP_OBJ | GROUP)); if (!new_style) { /* Fix up CLASS_OBJ value. */ - if (type & (USER | GROUP)) + if (type & (USER | GROUP_OBJ | GROUP)) { has_class_perm = true; - class_perm |= lacl[pos].a_perm; + /* Accommodate Windows: Never add SYSTEM and Admins + perms to CLASS_OBJ perms. */ + if (ace_sid != well_known_system_sid + && ace_sid != well_known_admins_sid) + class_perm |= lacl[pos].a_perm; } } } @@ -686,17 +754,21 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, if ((pos = searchace (lacl, MAX_ACL_ENTRIES, type, id)) >= 0) { getace (lacl[pos], type, id, ace->Mask, ace->Header.AceType, - new_style && type & (USER | GROUP)); + new_style && type & (USER | GROUP_OBJ | GROUP)); if (!new_style) { /* Fix up DEF_CLASS_OBJ value. */ - if (type & (USER | GROUP)) + if (type & (USER | GROUP_OBJ | GROUP)) { has_def_class_perm = true; + /* Accommodate Windows: Never add SYSTEM and Admins + perms to CLASS_OBJ perms. */ + if (ace_sid != well_known_system_sid + && ace_sid != well_known_admins_sid) def_class_perm |= lacl[pos].a_perm; } /* And note the position of the DEF_GROUP_OBJ entry. */ - else if (type == DEF_GROUP_OBJ) + if (type == DEF_GROUP_OBJ) def_pgrp_pos = pos; } } @@ -713,6 +785,21 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, lacl[pos].a_id = ILLEGAL_GID; lacl[pos].a_perm = class_perm | lacl[1].a_perm; } + /* If this is a just created file, and there are no default permissions + (probably no inherited ACEs so created from a default DACL), assign + the permissions specified by the file creation mask. The values get + masked by the actually requested permissions by the caller. + See POSIX 1003.1e draft 17. */ + if (just_created) + { + mode_t perms = (S_IRWXU | S_IRWXG | S_IRWXO) & ~cygheap->umask; + if (!saw_user_obj) + lacl[0].a_perm = (perms >> 6) & S_IRWXO; + if (!saw_group_obj) + lacl[1].a_perm = (perms >> 3) & S_IRWXO; + if (!saw_other_obj) + lacl[2].a_perm = perms & S_IRWXO; + } /* Ensure that the default acl contains at least DEF_(USER|GROUP|OTHER)_OBJ entries. */ if (types_def && (pos = searchace (lacl, MAX_ACL_ENTRIES, 0)) >= 0) diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index c50f515cf..c2d30b5af 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -15,6 +15,7 @@ details. */ #include "winsup.h" #include #include +#include #include "cygerrno.h" #include "security.h" #include "path.h" @@ -34,7 +35,6 @@ static GENERIC_MAPPING NO_COPY_RO file_mapping = { FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE, FILE_ALL_ACCESS }; - LONG get_file_sd (HANDLE fh, path_conv &pc, security_descriptor &sd, bool justcreated) @@ -85,62 +85,46 @@ get_file_sd (HANDLE fh, path_conv &pc, security_descriptor &sd, return -1; } } - /* Ok, so we have a security descriptor now. Unfortunately, if you want - to know if an ACE is inherited from the parent object, you can't just - call NtQuerySecurityObject once. The problem is this: + /* We have a security descriptor now. Unfortunately, if you want to know + if an ACE is inherited from the parent object, this isn't sufficient. In the simple case, the SDs control word contains one of the SE_DACL_AUTO_INHERITED or SE_DACL_PROTECTED flags, or at least one of - the ACEs has the INHERITED_ACE flag set. In all of these cases the - GetSecurityInfo function calls NtQuerySecurityObject only once, too, - apparently because it figures that the DACL is self-sufficient, which - it usually is. Windows Explorer, for instance, takes great care to - set these flags in a security descriptor if you change the ACL in the - GUI property dialog. + the ACEs has the INHERITED_ACE flag set. In all of these cases we + know the DACL has been inherited. - The tricky case is if none of these flags is set in the SD. That means - the information whether or not an ACE has been inherited is not available - in the DACL of the object. In this case GetSecurityInfo also fetches the - SD from the parent directory and tests if the object's SD contains - inherited ACEs from the parent. The below code is closly emulating the - behaviour of GetSecurityInfo so we can get rid of this advapi32 dependency. + If none of these flags is set in the SD, the information whether + or not an ACE has been inherited is not available in the DACL of the + object. In this case GetSecurityInfo fetches the SD from the parent + directory and tests if the object's SD contains inherited ACEs from the + parent. - However, this functionality is slow, and the extra information is only - required when the file has been created and the permissions are about - to be set to POSIX permissions. Therefore we only use it in case the - file just got created. + Note that we're not testing the SE_DACL_AUTO_INHERITED and + SE_DACL_PROTECTED flags here because we know the state the file's SD + is in. Since we're creating all files with a NULL descriptor, the DACL + is either inherited from the parent, or it's the default DACL. In + neither case, one of these flags is set. - Note that GetSecurityInfo has a problem on 5.1 and 5.2 kernels. Sometimes - it returns ERROR_INVALID_ADDRESS if a former request for the parent - directories' SD used NtQuerySecurityObject, rather than GetSecurityInfo - as well. See http://cygwin.com/ml/cygwin-developers/2011-03/msg00027.html - for the solution. This problem does not occur with the below code, so - the workaround has been removed. */ + For speed, we're not calling RtlConvertToAutoInheritSecurityObject + anymore (but keep the code here for reference). Rather we just test + if one of the parent's ACEs is inheritable. If so, we know we inherited + it and set the SE_DACL_AUTO_INHERITED flag. If not, we may assume our + object's DACL is the default DACL. + + This functionality is slow and the extra information is only required + when the file has been created and the permissions are about to be set + to POSIX permissions. Therefore we only use it in case the file just + got created. */ if (justcreated) { - SECURITY_DESCRIPTOR_CONTROL ctrl; - ULONG dummy; PACL dacl; BOOLEAN exists, def; ACCESS_ALLOWED_ACE *ace; UNICODE_STRING dirname; - PSECURITY_DESCRIPTOR psd, nsd; + PSECURITY_DESCRIPTOR psd; tmp_pathbuf tp; - /* Check SDs control flags. If SE_DACL_AUTO_INHERITED or - SE_DACL_PROTECTED is set we're done. */ - RtlGetControlSecurityDescriptor (sd, &ctrl, &dummy); - if (ctrl & (SE_DACL_AUTO_INHERITED | SE_DACL_PROTECTED)) - return 0; - /* Otherwise iterate over the ACEs and see if any one of them has the - INHERITED_ACE flag set. If so, we're done. */ - if (NT_SUCCESS (RtlGetDaclSecurityDescriptor (sd, &exists, &dacl, &def)) - && exists && dacl) - for (ULONG idx = 0; idx < dacl->AceCount; ++idx) - if (NT_SUCCESS (RtlGetAce (dacl, idx, (PVOID *) &ace)) - && (ace->Header.AceFlags & INHERITED_ACE)) - return 0; - /* Otherwise, open the parent directory with READ_CONTROL... */ + /* Open the parent directory with READ_CONTROL... */ RtlSplitUnicodePath (pc.get_nt_native_path (), &dirname, NULL); InitializeObjectAttributes (&attr, &dirname, pc.objcaseinsensitive (), NULL, NULL); @@ -164,12 +148,14 @@ get_file_sd (HANDLE fh, path_conv &pc, security_descriptor &sd, &dirname, status); return 0; } +#if 0 /* ... and create a new security descriptor in which all inherited ACEs are marked with the INHERITED_ACE flag. For a description of the undocumented RtlConvertToAutoInheritSecurityObject function from ntdll.dll see the MSDN man page for the advapi32 function ConvertToAutoInheritPrivateObjectSecurity. Fortunately the latter is just a shim. */ + PSECURITY_DESCRIPTOR nsd; status = RtlConvertToAutoInheritSecurityObject (psd, sd, &nsd, NULL, pc.isdir (), &file_mapping); @@ -185,6 +171,36 @@ get_file_sd (HANDLE fh, path_conv &pc, security_descriptor &sd, len = RtlLengthSecurityDescriptor (nsd); memcpy ((PSECURITY_DESCRIPTOR) sd, nsd, len); RtlDeleteSecurityObject (&nsd); +#else + /* ... and check the parent descriptor for inheritable ACEs matching + our current object type (file/dir). The simple truth in our case + is, either the parent dir had inheritable ACEs and all our ACEs are + inherited, or the parent dir didn't have inheritable ACEs and all + our ACEs are taken from the default DACL. */ + bool inherited = false; + BYTE search_flags = pc.isdir () ? SUB_CONTAINERS_AND_OBJECTS_INHERIT + : SUB_OBJECTS_ONLY_INHERIT; + if (NT_SUCCESS (RtlGetDaclSecurityDescriptor (psd, &exists, &dacl, &def)) + && exists && dacl) + for (ULONG idx = 0; idx < dacl->AceCount; ++idx) + if (NT_SUCCESS (RtlGetAce (dacl, idx, (PVOID *) &ace)) + && (ace->Header.AceFlags & search_flags)) + { + inherited = true; + break; + } + /* Then, if the parent descriptor contained inheritable ACEs, we mark + the SD as SE_DACL_AUTO_INHERITED. Note that this requires the + matching check in get_posix_access. If we ever revert to + RtlConvertToAutoInheritSecurityObject, the check in get_posix_access + has to test every single ACE for the INHERITED_ACE flag again. */ + if (inherited + && NT_SUCCESS (RtlGetDaclSecurityDescriptor (sd, &exists, &dacl, + &def)) + && exists && dacl) + RtlSetControlSecurityDescriptor (sd, SE_DACL_AUTO_INHERITED, + SE_DACL_AUTO_INHERITED); +#endif } return 0; } @@ -340,363 +356,6 @@ add_access_denied_ace (PACL acl, DWORD attributes, PSID sid, size_t &len_add, return true; } -static PSECURITY_DESCRIPTOR -alloc_sd (path_conv &pc, uid_t uid, gid_t gid, int attribute, - security_descriptor &sd_ret) -{ - NTSTATUS status; - BOOLEAN dummy; - tmp_pathbuf tp; - - /* NOTE: If the high bit of attribute is set, we have just created - a file or directory. See below for an explanation. */ - - debug_printf("uid %u, gid %u, attribute 0%o", uid, gid, attribute); - - /* Get owner and group from current security descriptor. */ - PSID cur_owner_sid = NULL; - PSID cur_group_sid = NULL; - status = RtlGetOwnerSecurityDescriptor (sd_ret, &cur_owner_sid, &dummy); - if (!NT_SUCCESS (status)) - debug_printf ("RtlGetOwnerSecurityDescriptor: %y", status); - status = RtlGetGroupSecurityDescriptor (sd_ret, &cur_group_sid, &dummy); - if (!NT_SUCCESS (status)) - debug_printf ("RtlGetGroupSecurityDescriptor: %y", status); - - /* Get SID of owner. */ - cygsid owner_sid; - /* Check for current user first */ - if (uid == myself->uid) - owner_sid = cygheap->user.sid (); - else if (uid == ILLEGAL_UID) - owner_sid = cur_owner_sid; - else if (!owner_sid.getfrompw (internal_getpwuid (uid))) - { - set_errno (EINVAL); - return NULL; - } - owner_sid.debug_print ("alloc_sd: owner SID ="); - - /* Get SID of new group. */ - cygsid group_sid; - /* Check for current user first */ - if (gid == myself->gid) - group_sid = cygheap->user.groups.pgsid; - else if (gid == ILLEGAL_GID) - group_sid = cur_group_sid; - else if (!group_sid.getfromgr (internal_getgrgid (gid))) - { - set_errno (EINVAL); - return NULL; - } - group_sid.debug_print ("alloc_sd: group SID ="); - - /* Initialize local security descriptor. */ - SECURITY_DESCRIPTOR sd; - RtlCreateSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION); - - /* We set the SE_DACL_PROTECTED flag here to prevent the DACL from being - modified by inheritable ACEs. */ - RtlSetControlSecurityDescriptor (&sd, SE_DACL_PROTECTED, SE_DACL_PROTECTED); - - /* Create owner for local security descriptor. */ - status = RtlSetOwnerSecurityDescriptor (&sd, owner_sid, FALSE); - if (!NT_SUCCESS (status)) - { - __seterrno_from_nt_status (status); - return NULL; - } - - /* Create group for local security descriptor. */ - status = RtlSetGroupSecurityDescriptor (&sd, group_sid, FALSE); - if (!NT_SUCCESS (status)) - { - __seterrno_from_nt_status (status); - return NULL; - } - - /* Initialize local access control list. */ - PACL acl = (PACL) tp.w_get (); - RtlCreateAcl (acl, ACL_MAXIMUM_SIZE, ACL_REVISION); - - /* From here fill ACL. */ - size_t acl_len = sizeof (ACL); - /* Only used for sync objects (for ttys). The admins group should - always have the right to manipulate the ACL, so we have to make sure - that the ACL gives the admins group STANDARD_RIGHTS_ALL access. */ - bool saw_admins = false; - - /* Construct allow attribute for owner. - Don't set FILE_READ/WRITE_ATTRIBUTES unconditionally on Samba, otherwise - it enforces read permissions. Same for other's below. */ - DWORD owner_allow = STANDARD_RIGHTS_ALL - | (pc.fs_is_samba () - ? 0 : (FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES)); - if (attribute & S_IRUSR) - owner_allow |= FILE_GENERIC_READ; - if (attribute & S_IWUSR) - owner_allow |= FILE_GENERIC_WRITE; - if (attribute & S_IXUSR) - owner_allow |= FILE_GENERIC_EXECUTE & ~FILE_READ_ATTRIBUTES; - if (S_ISDIR (attribute) - && (attribute & (S_IWUSR | S_IXUSR)) == (S_IWUSR | S_IXUSR)) - owner_allow |= FILE_DELETE_CHILD; - /* For sync objects note that the owner is admin. */ - if (S_ISCHR (attribute) && owner_sid == well_known_admins_sid) - saw_admins = true; - - /* Construct allow attribute for group. */ - DWORD group_allow = STANDARD_RIGHTS_READ | SYNCHRONIZE - | (pc.fs_is_samba () ? 0 : FILE_READ_ATTRIBUTES); - if (attribute & S_IRGRP) - group_allow |= FILE_GENERIC_READ; - if (attribute & S_IWGRP) - group_allow |= FILE_GENERIC_WRITE; - if (attribute & S_IXGRP) - group_allow |= FILE_GENERIC_EXECUTE & ~FILE_READ_ATTRIBUTES; - if (S_ISDIR (attribute) - && (attribute & (S_IWGRP | S_IXGRP)) == (S_IWGRP | S_IXGRP) - && !(attribute & S_ISVTX)) - group_allow |= FILE_DELETE_CHILD; - /* For sync objects, add STANDARD_RIGHTS_ALL for admins group. */ - if (S_ISCHR (attribute) && group_sid == well_known_admins_sid) - { - group_allow |= STANDARD_RIGHTS_ALL; - saw_admins = true; - } - - /* Construct allow attribute for everyone. */ - DWORD other_allow = STANDARD_RIGHTS_READ | SYNCHRONIZE - | (pc.fs_is_samba () ? 0 : FILE_READ_ATTRIBUTES); - if (attribute & S_IROTH) - other_allow |= FILE_GENERIC_READ; - if (attribute & S_IWOTH) - other_allow |= FILE_GENERIC_WRITE; - if (attribute & S_IXOTH) - other_allow |= FILE_GENERIC_EXECUTE & ~FILE_READ_ATTRIBUTES; - if (S_ISDIR (attribute) - && (attribute & (S_IWOTH | S_IXOTH)) == (S_IWOTH | S_IXOTH) - && !(attribute & S_ISVTX)) - other_allow |= FILE_DELETE_CHILD; - - /* Construct SUID, SGID and VTX bits in NULL ACE. */ - DWORD null_allow = 0L; - if (attribute & (S_ISUID | S_ISGID | S_ISVTX)) - { - if (attribute & S_ISUID) - null_allow |= FILE_APPEND_DATA; - if (attribute & S_ISGID) - null_allow |= FILE_WRITE_DATA; - if (attribute & S_ISVTX) - null_allow |= FILE_READ_DATA; - } - - /* Add owner and group permissions if SIDs are equal - and construct deny attributes for group and owner. */ - bool isownergroup; - if ((isownergroup = (owner_sid == group_sid))) - owner_allow |= group_allow; - - DWORD owner_deny = ~owner_allow & (group_allow | other_allow); - owner_deny &= ~(STANDARD_RIGHTS_READ - | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES); - - DWORD group_deny = ~group_allow & other_allow; - group_deny &= ~(STANDARD_RIGHTS_READ | FILE_READ_ATTRIBUTES); - - /* Set deny ACE for owner. */ - if (owner_deny - && !add_access_denied_ace (acl, owner_deny, owner_sid, acl_len, - NO_INHERITANCE)) - return NULL; - /* Set deny ACE for group here to respect the canonical order, - if this does not impact owner */ - if (group_deny && !(group_deny & owner_allow) && !isownergroup - && !add_access_denied_ace (acl, group_deny, group_sid, acl_len, - NO_INHERITANCE)) - return NULL; - /* Set allow ACE for owner. */ - if (!add_access_allowed_ace (acl, owner_allow, owner_sid, acl_len, - NO_INHERITANCE)) - return NULL; - /* Set deny ACE for group, if still needed. */ - if ((group_deny & owner_allow) && !isownergroup - && !add_access_denied_ace (acl, group_deny, group_sid, acl_len, - NO_INHERITANCE)) - return NULL; - /* Set allow ACE for group. */ - if (!isownergroup - && !add_access_allowed_ace (acl, group_allow, group_sid, acl_len, - NO_INHERITANCE)) - return NULL; - - /* For sync objects, if we didn't see the admins group so far, add entry - with STANDARD_RIGHTS_ALL access. */ - if (S_ISCHR (attribute) && !saw_admins) - { - if (!add_access_allowed_ace (acl, STANDARD_RIGHTS_ALL, - well_known_admins_sid, acl_len, - NO_INHERITANCE)) - return NULL; - saw_admins = true; - } - - /* Set allow ACE for everyone. */ - if (!add_access_allowed_ace (acl, other_allow, well_known_world_sid, acl_len, - NO_INHERITANCE)) - return NULL; - /* Set null ACE for special bits. */ - if (null_allow - && !add_access_allowed_ace (acl, null_allow, well_known_null_sid, acl_len, - NO_INHERITANCE)) - return NULL; - - /* Fill ACL with unrelated ACEs from current security descriptor. */ - PACL oacl; - BOOLEAN acl_exists = FALSE; - ACCESS_ALLOWED_ACE *ace; - - status = RtlGetDaclSecurityDescriptor (sd_ret, &acl_exists, &oacl, &dummy); - if (NT_SUCCESS (status) && acl_exists && oacl) - for (DWORD i = 0; i < oacl->AceCount; ++i) - if (NT_SUCCESS (RtlGetAce (oacl, i, (PVOID *) &ace))) - { - cygpsid ace_sid ((PSID) &ace->SidStart); - - /* Always skip NULL SID as well as admins SID on virtual device files - in /proc/sys. */ - if (ace_sid == well_known_null_sid - || (S_ISCHR (attribute) && ace_sid == well_known_admins_sid)) - continue; - /* Check for ACEs which are always created in the preceding code - and check for the default inheritence ACEs which will be created - for just created directories. Skip them for just created - directories or if they are not inherited. If they are inherited, - make sure they are *only* inherited, so they don't collide with - the permissions set in this function. */ - if ((ace_sid == cur_owner_sid) - || (ace_sid == owner_sid) - || (ace_sid == cur_group_sid) - || (ace_sid == group_sid) - || (ace_sid == well_known_creator_owner_sid) - || (ace_sid == well_known_creator_group_sid) - || (ace_sid == well_known_world_sid)) - { - if ((S_ISDIR (attribute) && (attribute & S_JUSTCREATED)) - || (ace->Header.AceFlags - & (SUB_CONTAINERS_AND_OBJECTS_INHERIT)) == 0) - continue; - else - ace->Header.AceFlags |= INHERIT_ONLY; - } - if (attribute & S_JUSTCREATED) - { - /* Since files and dirs are created with a NULL descriptor, - inheritence rules kick in. If no inheritable entries exist - in the parent object, Windows will create entries from the - user token's default DACL in the file DACL. These entries - are not desired and we drop them silently. */ - if (!(ace->Header.AceFlags & INHERITED_ACE)) - continue; - /* Remove the INHERITED_ACE flag since on POSIX systems - inheritance is settled when the file has been created. - This also avoids error messages in Windows Explorer when - opening a file's security tab. Explorer complains if - inheritable ACEs are preceding non-inheritable ACEs. */ - ace->Header.AceFlags &= ~INHERITED_ACE; - /* However, if the newly created object is a directory, - it inherits the default ACL from its parent, so mark - all unrelated, inherited ACEs inheritable. */ - if (S_ISDIR (attribute)) - ace->Header.AceFlags |= SUB_CONTAINERS_AND_OBJECTS_INHERIT; - } - else if (uid == ILLEGAL_UID && gid == ILLEGAL_UID - && ace->Header.AceType == ACCESS_ALLOWED_ACE_TYPE - && ace_sid != well_known_creator_group_sid - && ace_sid != well_known_creator_owner_sid - && ace_sid != well_known_world_sid) - { - /* FIXME: Temporary workaround for the problem that chmod does - not affect the group permissions if other users and groups - in the ACL have more permissions than the primary group due - to the CLASS_OBJ emulation. The temporary workaround is to - disallow any secondary ACE in the ACL more permissions than - the primary group when writing a new ACL via chmod. */ - ace->Mask &= group_allow; - } - /* Add unrelated ACCESS_DENIED_ACE to the beginning but behind - the owner_deny, ACCESS_ALLOWED_ACE to the end. FIXME: this - would break the order of the inherit-only ACEs. */ - status = RtlAddAce (acl, ACL_REVISION, - ace->Header.AceType == ACCESS_DENIED_ACE_TYPE - ? (owner_deny ? 1 : 0) : MAXDWORD, - (LPVOID) ace, ace->Header.AceSize); - if (!NT_SUCCESS (status)) - { - __seterrno_from_nt_status (status); - return NULL; - } - acl_len += ace->Header.AceSize; - } - - /* Construct appropriate inherit attribute for new directories. Keep in - mind that we do this only for the sake of non-Cygwin applications. - Cygwin applications don't need this. */ - if (S_ISDIR (attribute) && (attribute & S_JUSTCREATED)) - { - const DWORD inherit = SUB_CONTAINERS_AND_OBJECTS_INHERIT | INHERIT_ONLY; - /* Set allow ACE for owner. */ - if (!add_access_allowed_ace (acl, owner_allow, - well_known_creator_owner_sid, acl_len, - inherit)) - return NULL; - /* Set allow ACE for group. */ - if (!add_access_allowed_ace (acl, group_allow, - well_known_creator_group_sid, acl_len, - inherit)) - return NULL; - /* Set allow ACE for everyone. */ - if (!add_access_allowed_ace (acl, other_allow, well_known_world_sid, - acl_len, inherit)) - return NULL; - } - - /* Set AclSize to computed value. */ - acl->AclSize = acl_len; - debug_printf ("ACL-Size: %d", acl_len); - - /* Create DACL for local security descriptor. */ - status = RtlSetDaclSecurityDescriptor (&sd, TRUE, acl, FALSE); - if (!NT_SUCCESS (status)) - { - __seterrno_from_nt_status (status); - return NULL; - } - - /* Make self relative security descriptor. */ - DWORD sd_size = 0; - RtlAbsoluteToSelfRelativeSD (&sd, sd_ret, &sd_size); - if (sd_size <= 0) - { - __seterrno (); - return NULL; - } - if (!sd_ret.malloc (sd_size)) - { - set_errno (ENOMEM); - return NULL; - } - status = RtlAbsoluteToSelfRelativeSD (&sd, sd_ret, &sd_size); - if (!NT_SUCCESS (status)) - { - __seterrno_from_nt_status (status); - return NULL; - } - debug_printf ("Created SD-Size: %u", sd_ret.size ()); - - return sd_ret; -} - void set_security_attribute (path_conv &pc, int attribute, PSECURITY_ATTRIBUTES psa, security_descriptor &sd) @@ -704,8 +363,9 @@ set_security_attribute (path_conv &pc, int attribute, PSECURITY_ATTRIBUTES psa, psa->lpSecurityDescriptor = sd.malloc (SECURITY_DESCRIPTOR_MIN_LENGTH); RtlCreateSecurityDescriptor ((PSECURITY_DESCRIPTOR) psa->lpSecurityDescriptor, SECURITY_DESCRIPTOR_REVISION); - psa->lpSecurityDescriptor = alloc_sd (pc, geteuid32 (), getegid32 (), - attribute, sd); + psa->lpSecurityDescriptor = set_posix_access (attribute, geteuid32 (), + getegid32 (), NULL, 0, + sd, false); } int @@ -744,8 +404,8 @@ get_object_attribute (HANDLE handle, uid_t *uidret, gid_t *gidret, if (get_object_sd (handle, sd)) return -1; - get_posix_access (sd, attribute, uidret, gidret, NULL, 0); - return 0; + return get_posix_access (sd, attribute, uidret, gidret, NULL, 0) >= 0 + ? 0 : -1; } int @@ -754,7 +414,7 @@ create_object_sd_from_attribute (HANDLE handle, uid_t uid, gid_t gid, { path_conv pc; if ((handle && get_object_sd (handle, sd)) - || !alloc_sd (pc, uid, gid, attribute, sd)) + || !set_posix_access (attribute, uid, gid, NULL, 0, sd, false)) return -1; return 0; } @@ -786,24 +446,72 @@ set_object_attribute (HANDLE handle, uid_t uid, gid_t gid, } int -set_file_attribute (HANDLE handle, path_conv &pc, - uid_t uid, gid_t gid, mode_t attribute) +set_created_file_access (HANDLE handle, path_conv &pc, mode_t attr) { int ret = -1; + security_descriptor sd, sd_ret; + mode_t attr_rd; + uid_t uid; + gid_t gid; + tmp_pathbuf tp; + aclent_t *aclp; + int nentries, idx; - if (pc.has_acls ()) + if (!get_file_sd (handle, pc, sd, true)) { - security_descriptor sd; - - if (!get_file_sd (handle, pc, sd, (bool)(attribute & S_JUSTCREATED)) - && alloc_sd (pc, uid, gid, attribute, sd)) - ret = set_file_sd (handle, pc, sd, - uid != ILLEGAL_UID || gid != ILLEGAL_GID); + attr |= S_JUSTCREATED; + if (pc.isdir ()) + attr |= S_IFDIR; + attr_rd = attr; + aclp = (aclent_t *) tp.c_get (); + if ((nentries = get_posix_access (sd, &attr_rd, &uid, &gid, + aclp, MAX_ACL_ENTRIES)) >= 0) + { + /* Symlinks always get the request POSIX perms. */ + if (S_ISLNK (attr)) + attr_rd = 0777; + /* Overwrite ACL permissions as required by POSIX 1003.1e + draft 17. */ + aclp[0].a_perm = ((attr & attr_rd) >> 6) & S_IRWXO; + if (nentries > MIN_ACL_ENTRIES + && (idx = searchace (aclp, nentries, CLASS_OBJ)) >= 0) + aclp[idx].a_perm = ((attr & attr_rd) >> 3) & S_IRWXO; + else + aclp[1].a_perm = ((attr & attr_rd) >> 3) & S_IRWXO; + if ((idx = searchace (aclp, nentries, OTHER_OBJ)) >= 0) + aclp[idx].a_perm = (attr & attr_rd) & S_IRWXO; + /* Construct appropriate inherit attribute for new directories. + Basically we do this only for the sake of non-Cygwin applications. + Cygwin applications don't need these. Additionally, if the + S_ISGID bit is set, propagate it. */ + if (S_ISDIR (attr)) + { + if (searchace (aclp, nentries, DEF_USER_OBJ) < 0) + { + aclp[nentries].a_type = DEF_USER_OBJ; + aclp[nentries].a_id = ILLEGAL_UID; + aclp[nentries++].a_perm = (attr >> 6) & S_IRWXO; + } + if (searchace (aclp, nentries, DEF_GROUP_OBJ) < 0) + { + aclp[nentries].a_type = DEF_GROUP_OBJ; + aclp[nentries].a_id = ILLEGAL_GID; + aclp[nentries++].a_perm = (attr >> 3) & S_IRWXO; + } + if (searchace (aclp, nentries, DEF_OTHER_OBJ) < 0) + { + aclp[nentries].a_type = DEF_OTHER_OBJ; + aclp[nentries].a_id = ILLEGAL_UID; + aclp[nentries++].a_perm = attr & S_IRWXO; + } + if (attr_rd & S_ISGID) + attr |= S_ISGID; + } + if (set_posix_access (attr, uid, gid, aclp, nentries, sd_ret, + pc.fs_is_samba ())) + ret = set_file_sd (handle, pc, sd_ret, attr_rd & S_ISGID); + } } - else - ret = 0; - syscall_printf ("%d = set_file_attribute(%S, %d, %d, 0%o)", - ret, pc.get_nt_native_path (), uid, gid, attribute); return ret; } diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h index 0378814ca..db5b9f65f 100644 --- a/winsup/cygwin/security.h +++ b/winsup/cygwin/security.h @@ -436,8 +436,7 @@ class path_conv; /* File manipulation */ int __reg3 get_file_attribute (HANDLE, path_conv &, mode_t *, uid_t *, gid_t *); -int __reg3 set_file_attribute (HANDLE, path_conv &, - uid_t, gid_t, mode_t); +int __reg3 set_created_file_access (HANDLE, path_conv &, mode_t); int __reg2 get_object_sd (HANDLE, security_descriptor &); int __reg3 get_object_attribute (HANDLE, uid_t *, gid_t *, mode_t *); int __reg3 set_object_attribute (HANDLE, uid_t, gid_t, mode_t); @@ -463,6 +462,9 @@ bool get_sids_info (cygpsid, cygpsid, uid_t * , gid_t *); struct acl; extern "C" int aclsort32 (int, int, struct acl *); extern "C" int acl32 (const char *, int, int, struct acl *); +int searchace (struct acl *, int, int, uid_t id = ILLEGAL_UID); +PSECURITY_DESCRIPTOR set_posix_access (mode_t, uid_t, gid_t, struct acl *, int, + security_descriptor &, bool); int get_posix_access (PSECURITY_DESCRIPTOR, mode_t *, uid_t *, gid_t *, struct acl *, int); int getacl (HANDLE, path_conv &, int, struct acl *); diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index d2fb3534b..5dc2a452c 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1412,8 +1412,7 @@ open (const char *unix_path, int flags, ...) } else if ((fh->is_fs_special () && fh->device_access_denied (flags)) - || !fh->open_with_arch (flags, (mode & 07777) - & ~cygheap->umask)) + || !fh->open_with_arch (flags, mode & 07777)) delete fh; else { From a5efc75cc195d2fa801b34461978440355dd9631 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sat, 4 Apr 2015 16:19:31 +0100 Subject: [PATCH 051/109] Initialize context before RtlContextCapture * exceptions.cc (call_signal_handler): Zero initialize context and set context flags, as RlCaptureContext doesn't. Signed-off-by: Jon TURNEY --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/exceptions.cc | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e53ff94db..6a8b8f5f0 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-04 Jon TURNEY + + * exceptions.cc (call_signal_handler): Zero initialize context and set + context flags, as RlCaptureContext doesn't. + 2015-04-10 Corinna Vinschen * fhandler.cc (fhandler_base::open_with_arch): Call open with mode diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 0d1f36d50..fe543aee4 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1496,8 +1496,12 @@ _cygtls::call_signal_handler () if (thissi.si_cyg) memcpy (&thiscontext.uc_mcontext, ((cygwin_exception *)thissi.si_cyg)->context(), sizeof(CONTEXT)); else - RtlCaptureContext ((CONTEXT *)&thiscontext.uc_mcontext); - /* FIXME: Really this should be the context which the signal interrupted? */ + { + /* FIXME: Really this should be the context which the signal interrupted? */ + memset(&thiscontext.uc_mcontext, 0, sizeof(struct __mcontext)); + thiscontext.uc_mcontext.ctxflags = CONTEXT_FULL; + RtlCaptureContext ((CONTEXT *)&thiscontext.uc_mcontext); + } /* FIXME: If/when sigaltstack is implemented, this will need to do something more complicated */ From 0a0565d88173668e256a81a6a3dea337745d8256 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 2 Apr 2015 18:15:07 +0100 Subject: [PATCH 052/109] Only construct ucontext for SA_SIGINFO signal handlers * exceptions.cc (call_signal_handler): Only bother to construct the ucontext for signal handlers with SA_SIGINFO set. Set mcontext.oldmask. Signed-off-by: Jon TURNEY --- winsup/cygwin/ChangeLog | 6 +++++ winsup/cygwin/exceptions.cc | 54 ++++++++++++++++++++++--------------- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 6a8b8f5f0..ec70f1a1f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2015-04-02 Jon TURNEY + + * exceptions.cc (call_signal_handler): Only bother to construct + the ucontext for signal handlers with SA_SIGINFO set. Set + mcontext.oldmask. + 2015-04-04 Jon TURNEY * exceptions.cc (call_signal_handler): Zero initialize context and set diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index fe543aee4..0c9ee1459 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1485,42 +1485,52 @@ _cygtls::call_signal_handler () debug_only_printf ("dealing with signal %d", sig); this_sa_flags = sa_flags; + sigset_t this_oldmask = set_process_mask_delta (); + /* Save information locally on stack to pass to handler. */ int thissig = sig; siginfo_t thissi = infodata; void (*thisfunc) (int, siginfo_t *, void *) = func; - ucontext_t thiscontext; - thiscontext.uc_link = 0; - thiscontext.uc_flags = 0; - if (thissi.si_cyg) - memcpy (&thiscontext.uc_mcontext, ((cygwin_exception *)thissi.si_cyg)->context(), sizeof(CONTEXT)); - else + ucontext_t context; + ucontext_t *thiscontext = NULL; + + /* Only make a context for SA_SIGINFO handlers */ + if (this_sa_flags & SA_SIGINFO) { - /* FIXME: Really this should be the context which the signal interrupted? */ - memset(&thiscontext.uc_mcontext, 0, sizeof(struct __mcontext)); - thiscontext.uc_mcontext.ctxflags = CONTEXT_FULL; - RtlCaptureContext ((CONTEXT *)&thiscontext.uc_mcontext); + context.uc_link = 0; + context.uc_flags = 0; + if (thissi.si_cyg) + memcpy (&context.uc_mcontext, ((cygwin_exception *)thissi.si_cyg)->context(), sizeof(CONTEXT)); + else + { + /* FIXME: Really this should be the context which the signal interrupted? */ + memset(&context.uc_mcontext, 0, sizeof(struct __mcontext)); + context.uc_mcontext.ctxflags = CONTEXT_FULL; + RtlCaptureContext ((CONTEXT *)&context.uc_mcontext); + } + + /* FIXME: If/when sigaltstack is implemented, this will need to do + something more complicated */ + context.uc_stack.ss_sp = NtCurrentTeb ()->Tib.StackBase; + context.uc_stack.ss_flags = 0; + if (!NtCurrentTeb ()->DeallocationStack) + context.uc_stack.ss_size = (uintptr_t)NtCurrentTeb ()->Tib.StackLimit - (uintptr_t)NtCurrentTeb ()->Tib.StackBase; + else + context.uc_stack.ss_size = (uintptr_t)NtCurrentTeb ()->DeallocationStack - (uintptr_t)NtCurrentTeb ()->Tib.StackBase; + + context.uc_sigmask = context.uc_mcontext.oldmask = this_oldmask; + + thiscontext = &context; } - /* FIXME: If/when sigaltstack is implemented, this will need to do - something more complicated */ - thiscontext.uc_stack.ss_sp = NtCurrentTeb ()->Tib.StackBase; - thiscontext.uc_stack.ss_flags = 0; - if (!NtCurrentTeb ()->DeallocationStack) - thiscontext.uc_stack.ss_size = (uintptr_t)NtCurrentTeb ()->Tib.StackLimit - (uintptr_t)NtCurrentTeb ()->Tib.StackBase; - else - thiscontext.uc_stack.ss_size = (uintptr_t)NtCurrentTeb ()->DeallocationStack - (uintptr_t)NtCurrentTeb ()->Tib.StackBase; - - sigset_t this_oldmask = set_process_mask_delta (); - thiscontext.uc_sigmask = this_oldmask; int this_errno = saved_errno; reset_signal_arrived (); incyg = false; sig = 0; /* Flag that we can accept another signal */ unlock (); /* unlock signal stack */ - thisfunc (thissig, &thissi, &thiscontext); + thisfunc (thissig, &thissi, thiscontext); incyg = true; set_signal_mask (_my_tls.sigmask, this_oldmask); From 0bb27f15ec3db37c704b345f67f51c31dd608b06 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sat, 4 Apr 2015 16:12:27 +0100 Subject: [PATCH 053/109] Set mcontext.cr2 to the faulting address * exceptions.cc (call_signal_handler): Set mcontext.cr2 to the faulting address. Signed-off-by: Jon TURNEY --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/exceptions.cc | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ec70f1a1f..6e71e610c 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-04 Jon TURNEY + + * exceptions.cc (call_signal_handler): Set mcontext.cr2 to the + faulting address. + 2015-04-02 Jon TURNEY * exceptions.cc (call_signal_handler): Only bother to construct diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 0c9ee1459..4a6c21e7c 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1521,6 +1521,10 @@ _cygtls::call_signal_handler () context.uc_sigmask = context.uc_mcontext.oldmask = this_oldmask; + context.uc_mcontext.cr2 = (thissi.si_signo == SIGSEGV + || thissi.si_signo == SIGBUS) + ? (uintptr_t) thissi.si_addr : 0; + thiscontext = &context; } From 42d0aa41211941db5af82eb6b47a81c8a669efe0 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 10 Apr 2015 20:41:00 +0200 Subject: [PATCH 054/109] Bump Cygwin version to 2.0.0. * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2000. (CYGWIN_VERSION_DLL_MINOR): Set to 0. * new-features.xml (ov-new2.0): Rename from ov-new1.7.36 and change version number to 2.0. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/include/cygwin/version.h | 4 ++-- winsup/cygwin/release/{1.7.36 => 2.0.0} | 0 winsup/doc/ChangeLog | 5 +++++ winsup/doc/new-features.xml | 2 +- 5 files changed, 13 insertions(+), 3 deletions(-) rename winsup/cygwin/release/{1.7.36 => 2.0.0} (100%) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 6e71e610c..22d1a8b6b 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-10 Corinna Vinschen + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2000. + (CYGWIN_VERSION_DLL_MINOR): Set to 0. + 2015-04-04 Jon TURNEY * exceptions.cc (call_signal_handler): Set mcontext.cr2 to the diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 71d118e41..7734b120b 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -42,8 +42,8 @@ details. */ the Cygwin shared library". This version is used to track important changes to the DLL and is mainly informative in nature. */ -#define CYGWIN_VERSION_DLL_MAJOR 1007 -#define CYGWIN_VERSION_DLL_MINOR 36 +#define CYGWIN_VERSION_DLL_MAJOR 2000 +#define CYGWIN_VERSION_DLL_MINOR 0 /* Major numbers before CYGWIN_VERSION_DLL_EPOCH are incompatible. */ diff --git a/winsup/cygwin/release/1.7.36 b/winsup/cygwin/release/2.0.0 similarity index 100% rename from winsup/cygwin/release/1.7.36 rename to winsup/cygwin/release/2.0.0 diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index 416390034..a0507a4c6 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-04-10 Corinna Vinschen + + * new-features.xml (ov-new2.0): Rename from ov-new1.7.36 and change + version number to 2.0. + 2015-04-02 David A. Wheeler * faq-setup.xml: Document how Cygwin secures installation and diff --git a/winsup/doc/new-features.xml b/winsup/doc/new-features.xml index 3f8b967a7..2d0ed0b03 100644 --- a/winsup/doc/new-features.xml +++ b/winsup/doc/new-features.xml @@ -4,7 +4,7 @@ What's new and what changed in Cygwin -What's new and what changed in 1.7.36 +What's new and what changed in 2.0 From 8ede2acefd1221f9af7c089f8ed4eaeea16409e9 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 11 Apr 2015 16:03:18 +0200 Subject: [PATCH 055/109] Fix typo in new fchmod implementation * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Fix typo in mask computation. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/fhandler_disk_file.cc | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 22d1a8b6b..e300ff6c6 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-11 Corinna Vinschen + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Fix typo in + mask computation. + 2015-04-10 Corinna Vinschen * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2000. diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index abc4b4134..2b30801bc 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -906,9 +906,9 @@ fhandler_disk_file::fchmod (mode_t mode) aclp[0].a_perm = (mode >> 6) & S_IRWXO; if (nentries > MIN_ACL_ENTRIES && (idx = searchace (aclp, nentries, CLASS_OBJ)) >= 0) - aclp[idx].a_perm = (mode >> 6) & S_IRWXO; + aclp[idx].a_perm = (mode >> 3) & S_IRWXO; else - aclp[1].a_perm = (mode >> 6) & S_IRWXO; + aclp[1].a_perm = (mode >> 3) & S_IRWXO; if ((idx = searchace (aclp, nentries, OTHER_OBJ)) >= 0) aclp[idx].a_perm = mode & S_IRWXO; if (pc.isdir ()) From 7d061316c0b7fa417cdd8f2540ec16743564e3f0 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sun, 12 Apr 2015 14:05:12 +0200 Subject: [PATCH 056/109] Don't rely on size argument in shmget call * shm.cc (shmget): Fetch segment size from server rather than using size argument to accommodate existing segments. Add comment to explain why. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/release/2.0.0 | 3 +++ winsup/cygwin/shm.cc | 9 ++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e300ff6c6..3d2bfef62 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2015-04-12 Corinna Vinschen + + * shm.cc (shmget): Fetch segment size from server rather than using + size argument to accommodate existing segments. Add comment to explain + why. + 2015-04-11 Corinna Vinschen * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Fix typo in diff --git a/winsup/cygwin/release/2.0.0 b/winsup/cygwin/release/2.0.0 index c9fdd8510..d35b7232e 100644 --- a/winsup/cygwin/release/2.0.0 +++ b/winsup/cygwin/release/2.0.0 @@ -58,3 +58,6 @@ Bug Fixes - Fix UTF-16 surrogate handling in wctomb and friends. Addresses: https://cygwin.com/ml/cygwin/2015-03/msg00452.html + +- Fix shmget usage of size parameter for already existing segments. + Addresses: https://cygwin.com/ml/cygwin/2015-04/msg00105.html diff --git a/winsup/cygwin/shm.cc b/winsup/cygwin/shm.cc index c5ab708a4..e209346f7 100644 --- a/winsup/cygwin/shm.cc +++ b/winsup/cygwin/shm.cc @@ -377,7 +377,14 @@ shmget (key_t key, size_t size, int shmflg) shmid and hdl value to the list. */ ssh_new_entry->shmid = shmid; ssh_new_entry->hdl = hdl; - ssh_new_entry->size = size; + /* Fetch segment size from server. If this is an already existing segment, + the size value in this shmget call is supposed to be meaningless. */ + struct shmid_ds stat; + client_request_shm stat_req (shmid, IPC_STAT, &stat); + if (stat_req.make_request () == -1 || stat_req.retval () == -1) + ssh_new_entry->size = size; + else + ssh_new_entry->size = stat.shm_segsz; ssh_new_entry->ref_count = 0; SLIST_INSERT_HEAD (&ssh_list, ssh_new_entry, ssh_next); SLIST_UNLOCK (); From cf6ff1c3216ab611b9fa4c46145b684b8d36ce1f Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sun, 12 Apr 2015 20:26:27 +0200 Subject: [PATCH 057/109] Fix pty permssion handling in new permission handling code * sec_acl.cc (set_posix_access): Always make sure Admins have WRITE_DAC and WRITE_OWNER permissions. * security.h (create_object_sd_from_attribute): Drop handle parameter from prototype. * security.cc (create_object_sd_from_attribute): Drop handle parameter. Just create the standard POSIXy security descriptor. (set_object_attribute): Accommodate dropped paramter in call to create_object_sd_from_attribute. * fhandler_tty.cc: Ditto, throughout. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 12 ++++++++++++ winsup/cygwin/fhandler_tty.cc | 15 ++++++--------- winsup/cygwin/sec_acl.cc | 16 ++++++++++++++++ winsup/cygwin/security.cc | 16 ++++++---------- winsup/cygwin/security.h | 4 ++-- 5 files changed, 42 insertions(+), 21 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3d2bfef62..b4c251ca4 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,15 @@ +2015-04-12 Corinna Vinschen + + * sec_acl.cc (set_posix_access): Always make sure Admins have + WRITE_DAC and WRITE_OWNER permissions. + * security.h (create_object_sd_from_attribute): Drop handle parameter + from prototype. + * security.cc (create_object_sd_from_attribute): Drop handle parameter. + Just create the standard POSIXy security descriptor. + (set_object_attribute): Accommodate dropped paramter in call to + create_object_sd_from_attribute. + * fhandler_tty.cc: Ditto, throughout. + 2015-04-12 Corinna Vinschen * shm.cc (shmget): Fetch segment size from server rather than using diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index daa24ebcc..ccb76d90e 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -387,9 +387,8 @@ fhandler_pty_slave::open (int flags, mode_t) sd.malloc (sizeof (SECURITY_DESCRIPTOR)); RtlCreateSecurityDescriptor (sd, SECURITY_DESCRIPTOR_REVISION); SECURITY_ATTRIBUTES sa = { sizeof (SECURITY_ATTRIBUTES), NULL, TRUE }; - if (!create_object_sd_from_attribute (NULL, myself->uid, myself->gid, - S_IFCHR | S_IRUSR | S_IWUSR | S_IWGRP, - sd)) + if (!create_object_sd_from_attribute (myself->uid, myself->gid, + S_IRUSR | S_IWUSR | S_IWGRP, sd)) sa.lpSecurityDescriptor = (PSECURITY_DESCRIPTOR) sd; acquire_output_mutex (INFINITE); inuse = get_ttyp ()->create_inuse (&sa); @@ -1093,7 +1092,7 @@ fhandler_pty_slave::fchmod (mode_t mode) sd.malloc (sizeof (SECURITY_DESCRIPTOR)); RtlCreateSecurityDescriptor (sd, SECURITY_DESCRIPTOR_REVISION); if (!get_object_attribute (input_available_event, &uid, &gid, NULL) - && !create_object_sd_from_attribute (NULL, uid, gid, S_IFCHR | mode, sd)) + && !create_object_sd_from_attribute (uid, gid, mode, sd)) ret = fch_set_sd (sd, false); errout: if (to_close) @@ -1126,8 +1125,7 @@ fhandler_pty_slave::fchown (uid_t uid, gid_t gid) if ((uid == ILLEGAL_UID || uid == o_uid) && (gid == ILLEGAL_GID || gid == o_gid)) ret = 0; - else if (!create_object_sd_from_attribute (input_available_event, - uid, gid, S_IFCHR | mode, sd)) + else if (!create_object_sd_from_attribute (uid, gid, mode, sd)) ret = fch_set_sd (sd, true); } errout: @@ -1598,9 +1596,8 @@ fhandler_pty_master::setup () /* Create security attribute. Default permissions are 0620. */ sd.malloc (sizeof (SECURITY_DESCRIPTOR)); RtlCreateSecurityDescriptor (sd, SECURITY_DESCRIPTOR_REVISION); - if (!create_object_sd_from_attribute (NULL, myself->uid, myself->gid, - S_IFCHR | S_IRUSR | S_IWUSR | S_IWGRP, - sd)) + if (!create_object_sd_from_attribute (myself->uid, myself->gid, + S_IRUSR | S_IWUSR | S_IWGRP, sd)) sa.lpSecurityDescriptor = (PSECURITY_DESCRIPTOR) sd; /* Carefully check that the input_available_event didn't already exist. diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 628b22146..80e45a484 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -141,6 +141,7 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, mode_t class_obj = 0, other_obj, group_obj, deny; DWORD access; int idx, start_idx, class_idx, tmp_idx; + bool dev_saw_admins = false; /* Initialize local security descriptor. */ RtlCreateSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION); @@ -335,6 +336,14 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, if (aclbufp[idx].a_perm == S_IRWXO) access |= FILE_DELETE_CHILD; } + /* For ptys check if the admins group is in the ACL. If so, + make sure the group has WRITE_DAC and WRITE_OWNER perms. */ + if (S_ISCHR (attr) && !dev_saw_admins + && aclsid[idx] == well_known_admins_sid) + { + access |= STD_RIGHTS_OWNER; + dev_saw_admins = true; + } if (aclbufp[idx].a_perm & S_IROTH) access |= FILE_ALLOW_READ; if (aclbufp[idx].a_perm & S_IWOTH) @@ -352,6 +361,13 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, return NULL; } } + /* For ptys if the admins group isn't in the ACL, add an ACE to make + sure the group has WRITE_DAC and WRITE_OWNER perms. */ + if (S_ISCHR (attr) && !dev_saw_admins + && !add_access_allowed_ace (acl, STD_RIGHTS_OWNER, + well_known_admins_sid, acl_len, + NO_INHERITANCE)) + return NULL; /* Create allow ACE for other. It's preceeded by class_obj if it exists. If so, skip it. */ if (aclbufp[idx].a_type & CLASS_OBJ) diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index c2d30b5af..ea8563417 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -409,14 +409,11 @@ get_object_attribute (HANDLE handle, uid_t *uidret, gid_t *gidret, } int -create_object_sd_from_attribute (HANDLE handle, uid_t uid, gid_t gid, - mode_t attribute, security_descriptor &sd) +create_object_sd_from_attribute (uid_t uid, gid_t gid, mode_t attribute, + security_descriptor &sd) { - path_conv pc; - if ((handle && get_object_sd (handle, sd)) - || !set_posix_access (attribute, uid, gid, NULL, 0, sd, false)) - return -1; - return 0; + return set_posix_access (S_IFCHR | attribute, uid, gid, NULL, 0, sd, false) + ? 0 : -1; } int @@ -434,12 +431,11 @@ set_object_sd (HANDLE handle, security_descriptor &sd, bool chown) } int -set_object_attribute (HANDLE handle, uid_t uid, gid_t gid, - mode_t attribute) +set_object_attribute (HANDLE handle, uid_t uid, gid_t gid, mode_t attribute) { security_descriptor sd; - if (create_object_sd_from_attribute (handle, uid, gid, attribute, sd) + if (create_object_sd_from_attribute (uid, gid, attribute, sd) || set_object_sd (handle, sd, uid != ILLEGAL_UID || gid != ILLEGAL_GID)) return -1; return 0; diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h index db5b9f65f..5378b2a45 100644 --- a/winsup/cygwin/security.h +++ b/winsup/cygwin/security.h @@ -440,8 +440,8 @@ int __reg3 set_created_file_access (HANDLE, path_conv &, mode_t); int __reg2 get_object_sd (HANDLE, security_descriptor &); int __reg3 get_object_attribute (HANDLE, uid_t *, gid_t *, mode_t *); int __reg3 set_object_attribute (HANDLE, uid_t, gid_t, mode_t); -int __reg3 create_object_sd_from_attribute (HANDLE, uid_t, gid_t, - mode_t, security_descriptor &); +int __reg3 create_object_sd_from_attribute (uid_t, gid_t, mode_t, + security_descriptor &); int __reg3 set_object_sd (HANDLE, security_descriptor &, bool); int __reg3 get_reg_attribute (HKEY hkey, mode_t *, uid_t *, gid_t *); From 40653522b942addc65070275c89078d15aa8b4d5 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 14 Apr 2015 10:42:29 +0200 Subject: [PATCH 058/109] Fix thinko in creating the {DEF_}CLASS_OBJ value on old-style ACLs * sec_acl.cc (get_posix_access): Don't use GROUP_OBJ access to fix up CLASS_OBJ mask on old-style ACLs. Fix a comment. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/sec_acl.cc | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b4c251ca4..47a4b1a6a 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-14 Corinna Vinschen + + * sec_acl.cc (get_posix_access): Don't use GROUP_OBJ access to fix up + CLASS_OBJ mask on old-style ACLs. Fix a comment. + 2015-04-12 Corinna Vinschen * sec_acl.cc (set_posix_access): Always make sure Admins have diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 80e45a484..97fc03b2f 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -739,11 +739,12 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, if (!new_style) { /* Fix up CLASS_OBJ value. */ - if (type & (USER | GROUP_OBJ | GROUP)) + if (type & (USER | GROUP)) { has_class_perm = true; - /* Accommodate Windows: Never add SYSTEM and Admins - perms to CLASS_OBJ perms. */ + /* Accommodate Windows: Never add SYSTEM and Admins to + CLASS_OBJ. Unless (implicitely) if they are the + GROUP_OBJ entry. */ if (ace_sid != well_known_system_sid && ace_sid != well_known_admins_sid) class_perm |= lacl[pos].a_perm; @@ -774,11 +775,12 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, if (!new_style) { /* Fix up DEF_CLASS_OBJ value. */ - if (type & (USER | GROUP_OBJ | GROUP)) + if (type & (USER | GROUP)) { has_def_class_perm = true; - /* Accommodate Windows: Never add SYSTEM and Admins - perms to CLASS_OBJ perms. */ + /* Accommodate Windows: Never add SYSTEM and Admins to + CLASS_OBJ. Unless (implicitely) if they are the + GROUP_OBJ entry. */ if (ace_sid != well_known_system_sid && ace_sid != well_known_admins_sid) def_class_perm |= lacl[pos].a_perm; From c7bd0c37781af176bb339738322b8202dc13a3d2 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 14 Apr 2015 16:57:23 +0200 Subject: [PATCH 059/109] Fix typo in comment Signed-off-by: Corinna Vinschen --- winsup/cygwin/sec_acl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 97fc03b2f..e7c8de641 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -743,7 +743,7 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, { has_class_perm = true; /* Accommodate Windows: Never add SYSTEM and Admins to - CLASS_OBJ. Unless (implicitely) if they are the + CLASS_OBJ. Unless (implicitly) if they are the GROUP_OBJ entry. */ if (ace_sid != well_known_system_sid && ace_sid != well_known_admins_sid) @@ -779,7 +779,7 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, { has_def_class_perm = true; /* Accommodate Windows: Never add SYSTEM and Admins to - CLASS_OBJ. Unless (implicitely) if they are the + CLASS_OBJ. Unless (implicitly) if they are the GROUP_OBJ entry. */ if (ace_sid != well_known_system_sid && ace_sid != well_known_admins_sid) From 5d31049e662805f2e43364f1980b8d84999c71c9 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 15 Apr 2015 17:20:14 +0200 Subject: [PATCH 060/109] Handle files with owner == group. * sec_acl.cc (set_posix_access): Handle files with owner == group. Rephrase switch statement checking against unfiltered a_type value. (get_posix_access): Handle files with owner == group. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 6 +++ winsup/cygwin/sec_acl.cc | 94 +++++++++++++++++++++++++++++++--------- 2 files changed, 80 insertions(+), 20 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 47a4b1a6a..9adade060 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2015-04-15 Corinna Vinschen + + * sec_acl.cc (set_posix_access): Handle files with owner == group. + Rephrase switch statement checking against unfiltered a_type value. + (get_posix_access): Handle files with owner == group. + 2015-04-14 Corinna Vinschen * sec_acl.cc (get_posix_access): Don't use GROUP_OBJ access to fix up diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index e7c8de641..a8ffbf038 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -141,6 +141,7 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, mode_t class_obj = 0, other_obj, group_obj, deny; DWORD access; int idx, start_idx, class_idx, tmp_idx; + bool owner_eq_group; bool dev_saw_admins = false; /* Initialize local security descriptor. */ @@ -165,6 +166,7 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, __seterrno_from_nt_status (status); return NULL; } + owner_eq_group = RtlEqualSid (owner, group); /* No POSIX ACL? Use attr to generate one from scratch. */ if (!aclbufp) @@ -198,26 +200,35 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, /* Collect SIDs of all entries in aclbufp. */ aclsid = (cygpsid *) tp.w_get (); for (idx = 0; idx < nentries; ++idx) - switch (aclbufp[idx].a_type & ~ACL_DEFAULT) + switch (aclbufp[idx].a_type) { case USER_OBJ: - aclsid[idx] = (aclbufp[idx].a_type & ACL_DEFAULT) - ? (PSID) well_known_creator_owner_sid : owner; + aclsid[idx] = owner; + break; + case DEF_USER_OBJ: + aclsid[idx] = well_known_creator_owner_sid; break; case USER: + case DEF_USER: aclsid[idx] = sidfromuid (aclbufp[idx].a_id, &cldap); break; case GROUP_OBJ: - aclsid[idx] = (aclbufp[idx].a_type & ACL_DEFAULT && !(attr & S_ISGID)) - ? (PSID) well_known_creator_group_sid : group; + aclsid[idx] = group; + break; + case DEF_GROUP_OBJ: + aclsid[idx] = !(attr & S_ISGID) ? (PSID) well_known_creator_group_sid + : group; break; case GROUP: + case DEF_GROUP: aclsid[idx] = sidfromgid (aclbufp[idx].a_id, &cldap); break; case CLASS_OBJ: + case DEF_CLASS_OBJ: aclsid[idx] = well_known_null_sid; break; case OTHER_OBJ: + case DEF_OTHER_OBJ: aclsid[idx] = well_known_world_sid; break; } @@ -256,6 +267,11 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, tmp_idx = searchace (aclbufp, nentries, def | OTHER_OBJ); other_obj = aclbufp[tmp_idx].a_perm; + /* Do we potentially chmod a file with owner SID == group SID? If so, + make sure the owner perms are always >= group perms. */ + if (!def && owner_eq_group) + aclbufp[0].a_perm |= group_obj; + /* ... class_obj. Create Cygwin ACE. Only the S_ISGID attribute gets inherited. */ access = CYG_ACE_ISBITS_TO_WIN (def ? attr & S_ISGID : attr); @@ -514,11 +530,13 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, cygpsid ace_sid; int pos, type, id, idx; + bool owner_eq_group; bool just_created = false; bool new_style = false; bool saw_user_obj = false; bool saw_group_obj = false; bool saw_other_obj = false; + bool saw_def_user_obj = false; bool saw_def_group_obj = false; bool has_class_perm = false; bool has_def_class_perm = false; @@ -585,6 +603,8 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, attr = *attr_ret & S_IFMT; just_created = *attr_ret & S_JUSTCREATED; } + /* Remember the fact that owner and group are the same account. */ + owner_eq_group = owner_sid == group_sid; /* Create and initialize local aclent_t array. */ lacl = (aclent_t *) tp.c_get (); @@ -690,6 +710,7 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, type = DEF_USER_OBJ; types_def |= type; id = ILLEGAL_GID; + saw_def_user_obj = true; } else if (ace_sid == well_known_creator_group_sid) { @@ -703,25 +724,38 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, id = ace_sid.get_id (TRUE, &type, &cldap); if (!type) continue; - /* If the SGID attribute is set on a new-style Cygwin ACL on - a just created file or dir, the first group in the ACL is - the desired primary group of the new object. */ - if (just_created && new_style && attr & S_ISGID - && !saw_group_obj && type == GROUP) - { - type = GROUP_OBJ; - lacl[1].a_id = gid = id; - } + } + /* If the SGID attribute is set on a just created file or dir, the + first group in the ACL is the desired primary group of the new + object. Alternatively, the first repetition of the owner SID is + the desired primary group, and we mark the object as owner_eq_group + object. */ + if (just_created && attr & S_ISGID && !saw_group_obj + && (type == GROUP || (type == USER_OBJ && saw_user_obj))) + { + type = GROUP_OBJ; + lacl[1].a_id = gid = id; + owner_eq_group = true; } if (!(ace->Header.AceFlags & INHERIT_ONLY || type & ACL_DEFAULT)) { if (type == USER_OBJ) { - /* If we get a second entry for the owner, it's an additional - USER entry. This can happen when chown'ing a file. */ + /* If we get a second entry for the owner SID, it's either a + GROUP_OBJ entry for the same SID, if owner SID == group SID, + or it's an additional USER entry. The latter can happen + when chown'ing a file. */ if (saw_user_obj) - type = USER; - if (ace->Header.AceType == ACCESS_ALLOWED_ACE_TYPE) + { + if (owner_eq_group && !saw_group_obj) + { + type = GROUP_OBJ; + saw_group_obj = true; + } + else + type = USER; + } + else if (ace->Header.AceType == ACCESS_ALLOWED_ACE_TYPE) saw_user_obj = true; } else if (type == GROUP_OBJ) @@ -755,8 +789,23 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, if ((ace->Header.AceFlags & SUB_CONTAINERS_AND_OBJECTS_INHERIT)) { if (type == USER_OBJ) - type = USER; - else if (type == GROUP_OBJ) + { + /* As above: If we get a second entry for the owner SID, it's + a GROUP_OBJ entry for the same SID if owner SID == group SID, + but this time only if the S_ISGID bit is set. Otherwise it's + an additional USER entry. */ + if (saw_def_user_obj) + { + if (owner_eq_group && !saw_def_group_obj && attr & S_ISGID) + type = GROUP_OBJ; /* This needs post-processing in the + following GROUP_OBJ handling... */ + else + type = USER; + } + else if (ace->Header.AceType == ACCESS_ALLOWED_ACE_TYPE) + saw_def_user_obj = true; + } + if (type == GROUP_OBJ) { /* If the SGID bit is set, the inheritable entry for the primary group is, in fact, the DEF_GROUP_OBJ entry, @@ -897,6 +946,11 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, && !(lacl[idx].a_perm & DENY_RWX)) lacl[idx].a_perm |= lacl[2].a_perm & S_IRWXO; } + /* If owner SID == group SID (Microsoft Accounts) merge group perms into + user perms but leave group perms intact. That's a fake, but it allows + to keep track of the POSIX group perms without much effort. */ + if (owner_eq_group) + lacl[0].a_perm |= lacl[1].a_perm; /* Construct POSIX permission bits. Fortunately we know exactly where to fetch the affecting bits from, at least as long as the array hasn't been sorted. */ From bd57946148b82afe7c3e73b6d1ba7a5b8f73f36e Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 16 Apr 2015 13:31:16 +0200 Subject: [PATCH 061/109] Add output of effective rights to getfacl * getfacl.c (usage): Align more closely to Linux version. Add new options -c, -e, -E. Change formatting to accommodate longer options. (longopts): Rename --noname to --numeric. Keep --noname for backward compatibility. Add --omit-header, --all-effective and --no-effective options. (opts): Add -c, -e and -E option. (main): Handle new -c, -e, and -E options. Signed-off-by: Corinna Vinschen --- winsup/doc/ChangeLog | 4 + winsup/doc/utils.xml | 13 +-- winsup/utils/ChangeLog | 10 +++ winsup/utils/getfacl.c | 185 ++++++++++++++++++++++++++++------------- 4 files changed, 147 insertions(+), 65 deletions(-) diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index a0507a4c6..05cf5199a 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-04-16 Corinna Vinschen + + * utils.xml (getfacl): Show new option output. + 2015-04-10 Corinna Vinschen * new-features.xml (ov-new2.0): Rename from ov-new1.7.36 and change diff --git a/winsup/doc/utils.xml b/winsup/doc/utils.xml index adafc2b7d..d711cf242 100644 --- a/winsup/doc/utils.xml +++ b/winsup/doc/utils.xml @@ -519,11 +519,14 @@ Usage: getfacl [-adn] FILE [FILE2...] Display file and directory access control lists (ACLs). - -a, --access display the file access control list - -d, --default display the default access control list - -h, --help print help explaining the command line options - -n, --noname display user and group IDs instead of names - -V, --version output version information and exit + -a, --access display the file access control list only + -d, --default display the default access control list only + -c, --omit-header do not display the comment header + -e, --all-effective print all effective rights + -E, --no-effective print no effective rights + -n, --numeric print numeric user/group identifiers + -V, --version print version and exit + -h, --help this help text When multiple files are specified on the command line, a blank line separates the ACLs for each file. diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index ef6d32e7d..5e7025da6 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,13 @@ +2015-04-16 Corinna Vinschen + + * getfacl.c (usage): Align more closely to Linux version. Add new + options -c, -e, -E. Change formatting to accommodate longer options. + (longopts): Rename --noname to --numeric. Keep --noname for backward + compatibility. Add --omit-header, --all-effective and --no-effective + options. + (opts): Add -c, -e and -E option. + (main): Handle new -c, -e, and -E options. + 2015-02-28 Corinna Vinschen * getfacl.c (usage): Change --all to --access, --dir to --default. diff --git a/winsup/utils/getfacl.c b/winsup/utils/getfacl.c index 0bc484877..07d8a8a9f 100644 --- a/winsup/utils/getfacl.c +++ b/winsup/utils/getfacl.c @@ -66,61 +66,68 @@ static void usage (FILE * stream) { fprintf (stream, "Usage: %s [-adn] FILE [FILE2...]\n" - "\n" - "Display file and directory access control lists (ACLs).\n" - "\n" - " -a, --access display the file access control list\n" - " -d, --default display the default access control list\n" - " -h, --help print help explaining the command line options\n" - " -n, --noname display user and group IDs instead of names\n" - " -V, --version output version information and exit\n" - "\n" - "When multiple files are specified on the command line, a blank\n" - "line separates the ACLs for each file.\n", prog_name); + "\n" + "Display file and directory access control lists (ACLs).\n" + "\n" + " -a, --access display the file access control list only\n" + " -d, --default display the default access control list only\n" + " -c, --omit-header do not display the comment header\n" + " -e, --all-effective print all effective rights\n" + " -E, --no-effective print no effective rights\n" + " -n, --numeric print numeric user/group identifiers\n" + " -V, --version print version and exit\n" + " -h, --help this help text\n" + "\n" + "When multiple files are specified on the command line, a blank\n" + "line separates the ACLs for each file.\n", prog_name); if (stream == stdout) { fprintf (stream, "" - "For each argument that is a regular file, special file or\n" - "directory, getfacl displays the owner, the group, and the ACL.\n" - "For directories getfacl displays additionally the default ACL.\n" - "\n" - "With no options specified, getfacl displays the filename, the\n" - "owner, the group, the setuid (s), setgid (s), and sticky (t)\n" - "bits if available, and both the ACL and the default ACL, if it\n" - "exists.\n" - "\n" - "The format for ACL output is as follows:\n" - " # file: filename\n" - " # owner: name or uid\n" - " # group: name or uid\n" - " # flags: sst\n" - " user::perm\n" - " user:name or uid:perm\n" - " group::perm\n" - " group:name or gid:perm\n" - " mask:perm\n" - " other:perm\n" - " default:user::perm\n" - " default:user:name or uid:perm\n" - " default:group::perm\n" - " default:group:name or gid:perm\n" - " default:mask:perm\n" - " default:other:perm\n" - "\n"); + "For each argument that is a regular file, special file or\n" + "directory, getfacl displays the owner, the group, and the ACL.\n" + "For directories getfacl displays additionally the default ACL.\n" + "\n" + "With no options specified, getfacl displays the filename, the\n" + "owner, the group, the setuid (s), setgid (s), and sticky (t)\n" + "bits if available, and both the ACL and the default ACL, if it\n" + "exists.\n" + "\n" + "The format for ACL output is as follows:\n" + " # file: filename\n" + " # owner: name or uid\n" + " # group: name or uid\n" + " # flags: sst\n" + " user::perm\n" + " user:name or uid:perm\n" + " group::perm\n" + " group:name or gid:perm\n" + " mask:perm\n" + " other:perm\n" + " default:user::perm\n" + " default:user:name or uid:perm\n" + " default:group::perm\n" + " default:group:name or gid:perm\n" + " default:mask:perm\n" + " default:other:perm\n" + "\n"); } } struct option longopts[] = { {"access", no_argument, NULL, 'a'}, {"all", no_argument, NULL, 'a'}, + {"omit-header", no_argument, NULL, 'c'}, + {"all-effective", no_argument, NULL, 'e'}, + {"no-effective", no_argument, NULL, 'E'}, {"default", no_argument, NULL, 'd'}, {"dir", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, - {"noname", no_argument, NULL, 'n'}, + {"noname", no_argument, NULL, 'n'}, /* Backward compat */ + {"numeric", no_argument, NULL, 'n'}, {"version", no_argument, NULL, 'V'}, {0, no_argument, NULL, 0} }; -const char *opts = "adhnV"; +const char *opts = "acdeEhnV"; static void print_version () @@ -142,8 +149,11 @@ main (int argc, char **argv) int c; int ret = 0; int aopt = 0; + int copt = 0; + int eopt = 0; int dopt = 0; int nopt = 0; + int istty = isatty (fileno (stdout)); struct stat st; aclent_t acls[MAX_ACL_ENTRIES]; @@ -155,9 +165,18 @@ main (int argc, char **argv) case 'a': aopt = 1; break; + case 'c': + copt = 1; + break; case 'd': dopt = 1; break; + case 'e': + eopt = 1; + break; + case 'E': + eopt = -1; + break; case 'h': usage (stdout); return 0; @@ -179,6 +198,8 @@ main (int argc, char **argv) for (; optind < argc; ++optind) { int i, num_acls; + mode_t mask = S_IRWXO, def_mask = S_IRWXO; + if (stat (argv[optind], &st) || (num_acls = acl (argv[optind], GETACL, MAX_ACL_ENTRIES, acls)) < 0) { @@ -187,28 +208,42 @@ main (int argc, char **argv) ret = 2; continue; } - printf ("# file: %s\n", argv[optind]); - if (nopt) + if (!copt) { - printf ("# owner: %lu\n", (unsigned long)st.st_uid); - printf ("# group: %lu\n", (unsigned long)st.st_gid); + printf ("# file: %s\n", argv[optind]); + if (nopt) + { + printf ("# owner: %lu\n", (unsigned long)st.st_uid); + printf ("# group: %lu\n", (unsigned long)st.st_gid); + } + else + { + printf ("# owner: %s\n", username (st.st_uid)); + printf ("# group: %s\n", groupname (st.st_gid)); + } + if (st.st_mode & (S_ISUID | S_ISGID | S_ISVTX)) + printf ("# flags: %c%c%c\n", (st.st_mode & S_ISUID) ? 's' : '-', + (st.st_mode & S_ISGID) ? 's' : '-', + (st.st_mode & S_ISVTX) ? 't' : '-'); } - else - { - printf ("# owner: %s\n", username (st.st_uid)); - printf ("# group: %s\n", groupname (st.st_gid)); - } - if (st.st_mode & (S_ISUID | S_ISGID | S_ISVTX)) - printf ("# flags: %c%c%c\n", (st.st_mode & S_ISUID) ? 's' : '-', - (st.st_mode & S_ISGID) ? 's' : '-', - (st.st_mode & S_ISVTX) ? 't' : '-'); for (i = 0; i < num_acls; ++i) { + if (acls[i].a_type == CLASS_OBJ) + mask = acls[i].a_perm; + else if (acls[i].a_type == DEF_CLASS_OBJ) + def_mask = acls[i].a_perm; + } + for (i = 0; i < num_acls; ++i) + { + int n = 0; + int print_effective = 0; + mode_t effective = acls[i].a_perm; + if (acls[i].a_type & ACL_DEFAULT) { if (aopt) continue; - printf ("default:"); + n += printf ("default:"); } else if (dopt) continue; @@ -219,18 +254,18 @@ main (int argc, char **argv) break; case USER: if (nopt) - printf ("user:%lu:", (unsigned long)acls[i].a_id); + n += printf ("user:%lu:", (unsigned long)acls[i].a_id); else - printf ("user:%s:", username (acls[i].a_id)); + n += printf ("user:%s:", username (acls[i].a_id)); break; case GROUP_OBJ: - printf ("group::"); + n += printf ("group::"); break; case GROUP: if (nopt) - printf ("group:%lu:", (unsigned long)acls[i].a_id); + n += printf ("group:%lu:", (unsigned long)acls[i].a_id); else - printf ("group:%s:", groupname (acls[i].a_id)); + n += printf ("group:%s:", groupname (acls[i].a_id)); break; case CLASS_OBJ: printf ("mask:"); @@ -239,7 +274,37 @@ main (int argc, char **argv) printf ("other:"); break; } - printf ("%s\n", permstr (acls[i].a_perm)); + n += printf ("%s", permstr (acls[i].a_perm)); + switch (acls[i].a_type) + { + case USER: + case GROUP_OBJ: + case GROUP: + effective = acls[i].a_perm & mask; + print_effective = 1; + break; + case DEF_USER: + case DEF_GROUP_OBJ: + case DEF_GROUP: + effective = acls[i].a_perm & def_mask; + print_effective = 1; + break; + } + if (print_effective && eopt >= 0 + && (eopt > 0 || effective != acls[i].a_perm)) + { + if (istty) + { + n = 40 - n; + if (n <= 0) + n = 1; + printf ("%*s", n, " "); + } + else + putchar ('\t'); + printf ("#effective:%s", permstr (effective)); + } + putchar ('\n'); } putchar ('\n'); } From baacff7c79d9837d59e1b1c2060eea054e534e5c Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 16 Apr 2015 17:57:53 +0200 Subject: [PATCH 062/109] Add mask recomputation as on Linux * setfacl.c: Align more to Linux tool. (delacl): New function to delete acl entries only. (modacl): Drop delete functionality. Add handling of recomputing the mask and default mask values. (delallacl): Rename from delacl. (setfacl): Call delacl in Delete case. Call delallacl in DeleteAll and DeleteDef case. (usage): Accommodate new options. Rearrange and rephrase slightly. (longopts): Emit 'x' in --delete case. Add --no-mask and --mask options. (opts): Add -x and -n options. (main): Handle -d and -x the same. Handle -n and --mask options. Drop handling for -r option. Signed-off-by: Corinna Vinschen --- winsup/doc/ChangeLog | 4 + winsup/doc/utils.xml | 94 +++++----- winsup/utils/ChangeLog | 16 ++ winsup/utils/setfacl.c | 381 ++++++++++++++++++++++++++--------------- 4 files changed, 314 insertions(+), 181 deletions(-) diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index 05cf5199a..fdf3708ec 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-04-16 Corinna Vinschen + + * utils.xml (setfacl): Show new option output. + 2015-04-16 Corinna Vinschen * utils.xml (getfacl): Show new option output. diff --git a/winsup/doc/utils.xml b/winsup/doc/utils.xml index d711cf242..09df8e02b 100644 --- a/winsup/doc/utils.xml +++ b/winsup/doc/utils.xml @@ -1698,34 +1698,31 @@ Example: regtool.exe get '\user\software\Microsoft\Clock\iFormat' setfacl -Usage: setfacl [-r] {-f ACL_FILE | -s acl_entries} FILE... - setfacl [-r] {-b|[-d acl_entries] [-m acl_entries]} FILE... +Usage: %s {-f ACL_FILE | -s acl_entries} FILE...\n" + %s {-b|[-x acl_entries] [-m acl_entries]} FILE...\n" +Modify file and directory access control lists (ACLs)\n" -Modify file and directory access control lists (ACLs) + -b, --remove-all remove all extended ACL entries\n" + -x, --delete delete one or more specified ACL entries\n" + -f, --file set ACL entries for FILE to ACL entries read\n" + from ACL_FILE\n" + -k, --remove-default remove all default ACL entries\n" + -m, --modify modify one or more specified ACL entries\n" + -n, --no-mask don't recalculate the effective rights mask\n" + --mask do recalculate the effective rights mask\n" + -s, --substitute substitute specified ACL entries on FILE\n" + -V, --version print version and exit\n" + -h, --help this help text\n" - -b, --remove-all remove all extended ACL entries - -d, --delete delete one or more specified ACL entries - -f, --file set ACL entries for FILE to ACL entries read - from a ACL_FILE - -k, --remove-default - remove all default ACL entries - -m, --modify modify one or more specified ACL entries - -r, --replace replace mask entry with maximum permissions - needed for the file group class - -s, --substitute substitute specified ACL entries for the - ACL of FILE - -h, --help output usage information and exit - -V, --version output version information and exit - -At least one of (-b, -d, -f, -k, -m, -s) must be specified +At least one of (-b, -x, -f, -k, -m, -s) must be specified\n" For each file given as parameter, setfacl will either replace its complete ACL (-s, -f), or it will add, modify, or delete ACL entries. - For more information on Cygwin and Windows ACLs, see see in the Cygwin User's Guide. + For more information on Cygwin and Windows ACLs, see + in the Cygwin User's Guide. Acl_entries are one or more comma-separated ACL entries from the following list: @@ -1752,13 +1749,14 @@ At least one of (-b, -d, -f, -k, -m, -s) must be specified The following options are supported: - -b Remove all extended ACL entries. The base - ACL entries of the owner, group and others are retained. + -b,--remove-all Remove all + extended ACL entries. The base ACL entries of the owner, group and + others are retained. - -d Delete one or more specified entries from the - file's ACL. The owner, group and others entries must not be deleted. - Acl_entries to be deleted should be specified without permissions, as in - the following list: + -x,--delete Delete one or + more specified entries from the file's ACL. The owner, group and others + entries must not be deleted. Acl_entries to be deleted should be + specified without permissions, as in the following list: u[ser]:uid[:] g[roup]:gid[:] @@ -1769,11 +1767,12 @@ At least one of (-b, -d, -f, -k, -m, -s) must be specified d[efault]:o[ther][:] - -f Take the Acl_entries from ACL_FILE one per - line. Whitespace characters are ignored, and the character "#" may be - used to start a comment. The special filename "-" indicates reading from - stdin. Note that you can use this with getfacl and - setfacl to copy ACLs from one file to another: + -f,--file Take the Acl_entries + from ACL_FILE one per line. Whitespace characters are ignored, and the + character "#" may be used to start a comment. The special filename "-" + indicates reading from stdin. Note that you can use this with + getfacl and setfacl to copy ACLs + from one file to another: $ getfacl source_file | setfacl -f - target_file @@ -1789,22 +1788,31 @@ $ getfacl source_file | setfacl -f - target_file file, one default group entry for the group of the file, one default mask entry for the file group class, and one default other entry. - -k Remove all default ACL entries. If no default - ACL entries exist, no warnings are issued. + -k,--remove-default Remove all + default ACL entries. If no default ACL entries exist, no warnings are + issued. - -m Add or modify one or more specified ACL - entries. Acl_entries is a comma-separated list of entries from the same - list as above. + -m,--modify Add or modify one + or more specified ACL entries. Acl_entries is a comma-separated list of + entries from the same list as above. - -r Causes the permissions specified in the mask - entry to be ignored and replaced by the maximum permissions needed for - the file group class. + -n,--no-mask Valid in + conjunction with -m. Do not recalculate the effective rights mask. + The default behavior of setfacl is to recalculate the ACL mask entry, + unless a mask entry was explicitly given. The mask entry is set to + the union of all permissions of the owning group, and all named user + and group entries. (These are exactly the entries affected by the + mask entry). - -s Like -f, but substitute the - file's ACL with Acl_entries specified in a comma-separated list on the - command line. + --mask Valid in conjunction with -m. Do + recalculate the effective rights mask, even if an ACL mask entry was + explicitly given. (See the -n option.) - While the -d and -m options + -s,--substitute Like + -f, but substitute the file's ACL with Acl_entries + specified in a comma-separated list on the command line. + + While the -x and -m options may be used in the same command, the -f and -s options may be used only exclusively. diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 5e7025da6..a48f8693f 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,19 @@ +2015-04-16 Corinna Vinschen + + * setfacl.c: Align more to Linux tool. + (delacl): New function to delete acl entries only. + (modacl): Drop delete functionality. Add handling of recomputing the + mask and default mask values. + (delallacl): Rename from delacl. + (setfacl): Call delacl in Delete case. Call delallacl in DeleteAll + and DeleteDef case. + (usage): Accommodate new options. Rearrange and rephrase slightly. + (longopts): Emit 'x' in --delete case. Add --no-mask and --mask + options. + (opts): Add -x and -n options. + (main): Handle -d and -x the same. Handle -n and --mask options. + Drop handling for -r option. + 2015-04-16 Corinna Vinschen * getfacl.c (usage): Align more closely to Linux version. Add new diff --git a/winsup/utils/setfacl.c b/winsup/utils/setfacl.c index ba674d009..20a42f33c 100644 --- a/winsup/utils/setfacl.c +++ b/winsup/utils/setfacl.c @@ -1,7 +1,7 @@ /* setfacl.c - Copyright 2000, 2001, 2002, 2003, 2006, 2008, 2009, 2010, 2011, 2014 - Red Hat Inc. + Copyright 2000, 2001, 2002, 2003, 2006, 2008, 2009, 2010, 2011, 2014, + 2015 Red Hat Inc. Written by Corinna Vinschen @@ -53,6 +53,8 @@ typedef enum { SetFromFile } action_t; +int mask_opt = 0; + mode_t getperm (char *in) { if (isdigit ((unsigned char) *in) && !in[1]) @@ -239,7 +241,7 @@ searchace (aclent_t *aclp, int nentries, int type, int id) } int -modacl (aclent_t *tgt, int tcnt, aclent_t *src, int scnt) +delacl (aclent_t *tgt, int tcnt, aclent_t *src, int scnt) { int t, s, i; @@ -249,25 +251,115 @@ modacl (aclent_t *tgt, int tcnt, aclent_t *src, int scnt) (src[s].a_type & (USER | GROUP)) ? src[s].a_id : -1); if (t < 0) return -1; - if (src[s].a_perm == ILLEGAL_MODE) + if (t < tcnt) { - if (t < tcnt) - { - for (i = t + 1; i < tcnt; ++i) - tgt[i - 1] = tgt[i]; - --tcnt; - } - } - else - { - tgt[t] = src[s]; - if (t >= tcnt) - ++tcnt; + for (i = t + 1; i < tcnt; ++i) + tgt[i - 1] = tgt[i]; + --tcnt; } } return tcnt; } +int +modacl (aclent_t *tgt, int tcnt, aclent_t *src, int scnt) +{ + int t, s; + int recompute_mask = 0, recompute_def_mask = 0; + int need_mask = 0, need_def_mask = 0; + int has_mask = 0, has_def_mask = 0; + int mask_idx = -1, def_mask_idx = -1; + mode_t mask = 0, def_mask = 0; + + /* Replace or add given acl entries. */ + for (s = 0; s < scnt; ++s) + { + t = searchace (tgt, MAX_ACL_ENTRIES, src[s].a_type, + (src[s].a_type & (USER | GROUP)) ? src[s].a_id : -1); + if (t < 0) + return -1; + tgt[t] = src[s]; + if (t >= tcnt) + ++tcnt; + /* Note if CLASS_OBJ and/or DEF_CLASS_OBJ are present in input. */ + if (src[s].a_type == CLASS_OBJ) + has_mask = 1; + else if (src[s].a_type == DEF_CLASS_OBJ) + has_def_mask = 1; + else if (src[s].a_type & ACL_DEFAULT) + recompute_def_mask = 1; + else + recompute_mask = 1; + } + /* Now recompute mask, if requested (default) */ + for (t = 0; t < tcnt; ++t) + { + switch (tgt[t].a_type) + { + case USER: + case GROUP: + /* Do we need a CLASS_OBJ at all? */ + need_mask = 1; + /*FALLTHRU*/ + case GROUP_OBJ: + /* Compute resulting maximum mask. */ + mask |= tgt[t].a_perm; + break; + case CLASS_OBJ: + /* Do we already have a CLASS_OBJ? */ + mask_idx = t; + break; + case DEF_USER: + case DEF_GROUP: + /* Do we need a DEF_CLASS_OBJ at all? */ + need_def_mask = 1; + /*FALLTHRU*/ + case DEF_GROUP_OBJ: + /* Compute resulting maximum default mask. */ + def_mask |= tgt[t].a_perm; + break; + case DEF_CLASS_OBJ: + /* Do we already have a DEF_CLASS_OBJ? */ + def_mask_idx = t; + break; + } + } + /* Recompute mask, if requested */ + if (recompute_mask && need_mask && mask_opt >= 0 + && (mask_opt > 0 || !has_mask)) + { + if (mask_idx >= 0) + t = mask_idx; + else + t = searchace (tgt, MAX_ACL_ENTRIES, CLASS_OBJ, -1); + if (t < 0) + return -1; + if (t >= tcnt) + ++tcnt; + tgt[t].a_type = CLASS_OBJ; + tgt[t].a_id = -1; + tgt[t].a_perm = mask; + } + /* Recompute default mask, if requested */ + if (recompute_def_mask && need_def_mask && mask_opt >= 0 + && (mask_opt > 0 || !has_def_mask)) + { + if (def_mask_idx >= 0) + t = def_mask_idx; + else + t = searchace (tgt, MAX_ACL_ENTRIES, DEF_CLASS_OBJ, -1); + if (t < 0) + return -1; + if (t >= tcnt) + ++tcnt; + tgt[t].a_type = DEF_CLASS_OBJ; + tgt[t].a_id = -1; + tgt[t].a_perm = def_mask; + } + + return tcnt; +} + int addmissing (aclent_t *tgt, int tcnt) { @@ -333,7 +425,7 @@ addmissing (aclent_t *tgt, int tcnt) } int -delacl (aclent_t *tgt, int tcnt, action_t action) +delallacl (aclent_t *tgt, int tcnt, action_t action) { int t; @@ -369,7 +461,7 @@ setfacl (action_t action, const char *path, aclent_t *acls, int cnt) break; case Delete: if ((lcnt = acl (path, GETACL, MAX_ACL_ENTRIES, lacl)) < 0 - || (lcnt = modacl (lacl, lcnt, acls, cnt)) < 0 + || (lcnt = delacl (lacl, lcnt, acls, cnt)) < 0 || (lcnt = acl (path, SETACL, lcnt, lacl)) < 0) { perror (prog_name); @@ -379,7 +471,7 @@ setfacl (action_t action, const char *path, aclent_t *acls, int cnt) case DeleteAll: case DeleteDef: if ((lcnt = acl (path, GETACL, MAX_ACL_ENTRIES, lacl)) < 0 - || (lcnt = delacl (lacl, lcnt, action)) < 0 + || (lcnt = delallacl (lacl, lcnt, action)) < 0 || (lcnt = acl (path, SETACL, lcnt, lacl)) < 0) { perror (prog_name); @@ -404,114 +496,126 @@ static void usage (FILE *stream) { fprintf (stream, "" - "Usage: %s [-r] {-f ACL_FILE | -s acl_entries} FILE...\n" - " %s [-r] {-b|[-d acl_entries] [-m acl_entries]} FILE...\n" - "\n" - "Modify file and directory access control lists (ACLs)\n" - "\n" - " -b, --remove-all remove all extended ACL entries\n" - " -d, --delete delete one or more specified ACL entries\n" - " -f, --file set ACL entries for FILE to ACL entries read\n" - " from a ACL_FILE\n" - " -k, --remove-default\n" - " remove all default ACL entries\n" - " -m, --modify modify one or more specified ACL entries\n" - " -r, --replace replace mask entry with maximum permissions\n" - " needed for the file group class\n" - " -s, --substitute substitute specified ACL entries for the\n" - " ACL of FILE\n" - " -h, --help output usage information and exit\n" - " -V, --version output version information and exit\n" - "\n" - "At least one of (-b, -d, -f, -k, -m, -s) must be specified\n" - "\n", prog_name, prog_name); - if (stream == stdout) - { - printf("" - " Acl_entries are one or more comma-separated ACL entries \n" - " from the following list:\n" - "\n" - " u[ser]::perm\n" - " u[ser]:uid:perm\n" - " g[roup]::perm\n" - " g[roup]:gid:perm\n" - " m[ask]:perm\n" - " o[ther]:perm\n" - "\n" - " Default entries are like the above with the additional\n" - " default identifier. For example: \n" - "\n" - " d[efault]:u[ser]:uid:perm\n" - "\n" - " 'perm' is either a 3-char permissions string in the form\n" - " \"rwx\" with the character - for no permission\n" - " or it is the octal representation of the permissions, a\n" - " value from 0 (equivalent to \"---\") to 7 (\"rwx\").\n" - " 'uid' is a user name or a numerical uid.\n" - " 'gid' is a group name or a numerical gid.\n" - "\n" - "\n" - "For each file given as parameter, %s will either replace its\n" - "complete ACL (-s, -f), or it will add, modify, or delete ACL\n" - "entries.\n" - "\n" - "The following options are supported:\n" - "\n" - "-b Remove all extended ACL entries. The base ACL entries of the\n" - " owner, group and others are retained.\n" - "\n" - "-d Delete one or more specified entries from the file's ACL.\n" - " The owner, group and others entries must not be deleted.\n" - " Acl_entries to be deleted should be specified without\n" - " permissions, as in the following list:\n" - "\n" - " u[ser]:uid[:]\n" - " g[roup]:gid[:]\n" - " m[ask][:]\n" - " d[efault]:u[ser][:uid]\n" - " d[efault]:g[roup][:gid]\n" - " d[efault]:m[ask][:]\n" - " d[efault]:o[ther][:]\n" - "\n" - "-f Take the Acl_entries from ACL_FILE one per line. Whitespace\n" - " characters are ignored, and the character \"#\" may be used\n" - " to start a comment. The special filename \"-\" indicates\n" - " reading from stdin.\n" - " Required entries are\n" - " - One user entry for the owner of the file.\n" - " - One group entry for the group of the file.\n" - " - One other entry.\n" - " If additional user and group entries are given:\n" - " - A mask entry for the file group class of the file.\n" - " - No duplicate user or group entries with the same uid/gid.\n" - " If it is a directory:\n" - " - One default user entry for the owner of the file.\n" - " - One default group entry for the group of the file.\n" - " - One default mask entry for the file group class.\n" - " - One default other entry.\n" - "\n" - "-k Remove all default ACL entries. If no default ACL entries\n" - " exist, no warnings are issued.\n" - "\n" - "-m Add or modify one or more specified ACL entries.\n" - " Acl_entries is a comma-separated list of entries from the \n" - " same list as above.\n" - "\n" - "-r Causes the permissions specified in the mask entry to be\n" - " ignored and replaced by the maximum permissions needed for\n" - " the file group class.\n" - "\n" - "-s Like -f, but substitute the file's ACL with Acl_entries\n" - " specified in a comma-separated list on the command line.\n" - "\n" - "While the -d and -m options may be used in the same command, the\n" - "-f and -s options may be used only exclusively.\n" - "\n" - "Directories may contain default ACL entries. Files created\n" - "in a directory that contains default ACL entries will have\n" - "permissions according to the combination of the current umask,\n" - "the explicit permissions requested and the default ACL entries\n" - "\n", prog_name); + "Usage: %s {-f ACL_FILE | -s acl_entries} FILE...\n" + " %s {-b|[-x acl_entries] [-m acl_entries]} FILE...\n" + "\n" + "Modify file and directory access control lists (ACLs)\n" + "\n" + " -b, --remove-all remove all extended ACL entries\n" + " -x, --delete delete one or more specified ACL entries\n" + " -f, --file set ACL entries for FILE to ACL entries read\n" + " from ACL_FILE\n" + " -k, --remove-default remove all default ACL entries\n" + " -m, --modify modify one or more specified ACL entries\n" + " -n, --no-mask don't recalculate the effective rights mask\n" + " --mask do recalculate the effective rights mask\n" + " -s, --substitute substitute specified ACL entries on FILE\n" + " -V, --version print version and exit\n" + " -h, --help this help text\n" + "\n" + "At least one of (-b, -x, -f, -k, -m, -s) must be specified\n" + "\n", prog_name, prog_name); + if (stream == stdout) + { + printf("" + " Acl_entries are one or more comma-separated ACL entries \n" + " from the following list:\n" + "\n" + " u[ser]::perm\n" + " u[ser]:uid:perm\n" + " g[roup]::perm\n" + " g[roup]:gid:perm\n" + " m[ask]:perm\n" + " o[ther]:perm\n" + "\n" + " Default entries are like the above with the additional\n" + " default identifier. For example: \n" + "\n" + " d[efault]:u[ser]:uid:perm\n" + "\n" + " 'perm' is either a 3-char permissions string in the form\n" + " \"rwx\" with the character - for no permission\n" + " or it is the octal representation of the permissions, a\n" + " value from 0 (equivalent to \"---\") to 7 (\"rwx\").\n" + " 'uid' is a user name or a numerical uid.\n" + " 'gid' is a group name or a numerical gid.\n" + "\n" + "\n" + "For each file given as parameter, %s will either replace its\n" + "complete ACL (-s, -f), or it will add, modify, or delete ACL\n" + "entries.\n" + "\n" + "The following options are supported:\n" + "\n" + "-b, --remove-all\n" + " Remove all extended ACL entries. The base ACL entries of the\n" + " owner, group and others are retained.\n" + "\n" + "-x, --delete\n" + " Delete one or more specified entries from the file's ACL.\n" + " The owner, group and others entries must not be deleted.\n" + " Acl_entries to be deleted should be specified without\n" + " permissions, as in the following list:\n" + "\n" + " u[ser]:uid[:]\n" + " g[roup]:gid[:]\n" + " m[ask][:]\n" + " d[efault]:u[ser][:uid]\n" + " d[efault]:g[roup][:gid]\n" + " d[efault]:m[ask][:]\n" + " d[efault]:o[ther][:]\n" + "\n" + "-f, --file\n" + " Take the Acl_entries from ACL_FILE one per line. Whitespace\n" + " characters are ignored, and the character \"#\" may be used\n" + " to start a comment. The special filename \"-\" indicates\n" + " reading from stdin.\n" + " Required entries are\n" + " - One user entry for the owner of the file.\n" + " - One group entry for the group of the file.\n" + " - One other entry.\n" + " If additional user and group entries are given:\n" + " - A mask entry for the file group class of the file.\n" + " - No duplicate user or group entries with the same uid/gid.\n" + " If it is a directory:\n" + " - One default user entry for the owner of the file.\n" + " - One default group entry for the group of the file.\n" + " - One default mask entry for the file group class.\n" + " - One default other entry.\n" + "\n" + "-k, --remove-default\n" + " Remove all default ACL entries. If no default ACL entries exist,\n" + " no warnings are issued.\n" + "\n" + "-m, --modify\n" + " Add or modify one or more specified ACL entries. Acl_entries is\n" + " a comma-separated list of entries from the same list as above.\n" + "\n" + "-n, --no-mask\n" + " Valid in conjunction with -m. Do not recalculate the effective\n" + " rights mask. The default behavior of setfacl is to recalculate the\n" + " ACL mask entry, unless a mask entry was explicitly given. The\n" + " mask entry is set to the union of all permissions of the owning\n" + " group, and all named user and group entries. (These are exactly\n" + " the entries affected by the mask entry).\n" + "\n" + "--mask\n" + " Valid in conjunction with -m. Do recalculate the effective rights\n" + " mask, even if an ACL mask entry was explicitly given. (See the\n" + " -n option.)\n" + "\n" + "-s, --substitute\n" + " Like -f, but substitute the file's ACL with ACL entries\n" + " specified in a comma-separated list on the command line.\n" + "\n" + "While the -x and -m options may be used in the same command, the\n" + "-f and -s options may be used only exclusively.\n" + "\n" + "Directories may contain default ACL entries. Files created\n" + "in a directory that contains default ACL entries will have\n" + "permissions according to the combination of the current umask,\n" + "the explicit permissions requested and the default ACL entries\n" + "\n", prog_name); } else fprintf(stream, "Try '%s --help' for more information.\n", prog_name); @@ -519,17 +623,19 @@ usage (FILE *stream) struct option longopts[] = { {"remove-all", no_argument, NULL, 'b'}, - {"delete", required_argument, NULL, 'd'}, + {"delete", required_argument, NULL, 'x'}, {"file", required_argument, NULL, 'f'}, {"remove-default", no_argument, NULL, 'k'}, {"modify", required_argument, NULL, 'm'}, + {"no-mask", required_argument, NULL, 'n'}, + {"mask", required_argument, NULL, '\n'}, {"replace", no_argument, NULL, 'r'}, {"substitute", required_argument, NULL, 's'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'V'}, {0, no_argument, NULL, 0} }; -const char *opts = "bd:f:hkm:rs:V"; +const char *opts = "bd:f:hkm:nrs:Vx"; static void print_version () @@ -550,7 +656,6 @@ main (int argc, char **argv) { int c; action_t action = NoAction; - int ropt = 0; aclent_t acls[MAX_ACL_ENTRIES]; int aclidx = 0; int ret = 0; @@ -570,7 +675,8 @@ main (int argc, char **argv) return 1; } break; - case 'd': + case 'd': /* Backward compat */ + case 'x': if (action == NoAction) action = Delete; else if (action == Modify) @@ -628,14 +734,13 @@ main (int argc, char **argv) return 2; } break; + case 'n': + mask_opt = -1; + break; + case '\n': + mask_opt = 1; + break; case 'r': - if (!ropt) - ropt = 1; - else - { - usage (stderr); - return 1; - } break; case 's': if (action == NoAction) From de67909ac180f15531e1a1bf4b5c54f17caae5d5 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 16 Apr 2015 18:29:16 +0200 Subject: [PATCH 063/109] Workaround owner/group SIDs being NULL * sec_acl.cc (set_posix_access): Workaround owner/group SIDs being NULL. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/sec_acl.cc | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9adade060..f645031a0 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2015-04-16 Corinna Vinschen + + * sec_acl.cc (set_posix_access): Workaround owner/group SIDs being NULL. + 2015-04-15 Corinna Vinschen * sec_acl.cc (set_posix_access): Handle files with owner == group. diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index a8ffbf038..6c96977b7 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -141,7 +141,7 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, mode_t class_obj = 0, other_obj, group_obj, deny; DWORD access; int idx, start_idx, class_idx, tmp_idx; - bool owner_eq_group; + bool owner_eq_group = false; bool dev_saw_admins = false; /* Initialize local security descriptor. */ @@ -166,7 +166,10 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, __seterrno_from_nt_status (status); return NULL; } - owner_eq_group = RtlEqualSid (owner, group); + /* If the account DBs are broken, we might end up without SIDs. Better + check them here. */ + if (owner && group) + owner_eq_group = RtlEqualSid (owner, group); /* No POSIX ACL? Use attr to generate one from scratch. */ if (!aclbufp) From ea503bf4c955857d9969d9896e98c7729b3ea845 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 16 Apr 2015 22:19:57 +0200 Subject: [PATCH 064/109] Better workaround owner/group SIDs being NULL * sec_acl.cc (set_posix_access): Replace previous patch. Return EINVAL if uid and/or guid is invalid and not backed by an actual Windows account. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/sec_acl.cc | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f645031a0..ce198e2df 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2015-04-16 Corinna Vinschen + + * sec_acl.cc (set_posix_access): Replace previous patch. Return + EINVAL if uid and/or guid is invalid and not backed by an actual + Windows account. + 2015-04-16 Corinna Vinschen * sec_acl.cc (set_posix_access): Workaround owner/group SIDs being NULL. diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 6c96977b7..58683cf9a 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -154,6 +154,11 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, /* Fetch owner and group and set in security descriptor. */ owner = sidfromuid (uid, &cldap); group = sidfromgid (gid, &cldap); + if (!owner || !group) + { + set_errno (EINVAL); + return NULL; + } status = RtlSetOwnerSecurityDescriptor (&sd, owner, FALSE); if (!NT_SUCCESS (status)) { @@ -166,10 +171,9 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, __seterrno_from_nt_status (status); return NULL; } - /* If the account DBs are broken, we might end up without SIDs. Better - check them here. */ - if (owner && group) - owner_eq_group = RtlEqualSid (owner, group); + owner_eq_group = RtlEqualSid (owner, group); + + /* No POSIX ACL? Use attr to generate one from scratch. */ if (!aclbufp) From a69b0cef71e808bebb9ed9fc0f62428710192be1 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 16 Apr 2015 22:23:46 +0200 Subject: [PATCH 065/109] Set GROUP_OBJ and CLASS_OBJ perms to new group perms * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Deliberatly set GROUP_OBJ and CLASS_OBJ perms to new group perms. Add comment to explain why. * security.cc (set_created_file_access): Ditto. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/fhandler_disk_file.cc | 7 +++++-- winsup/cygwin/security.cc | 7 +++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ce198e2df..9ec866f2e 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2015-04-16 Corinna Vinschen + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Deliberatly + set GROUP_OBJ and CLASS_OBJ perms to new group perms. Add comment + to explain why. + * security.cc (set_created_file_access): Ditto. + 2015-04-16 Corinna Vinschen * sec_acl.cc (set_posix_access): Replace previous patch. Return diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 2b30801bc..b283934c4 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -904,11 +904,14 @@ fhandler_disk_file::fchmod (mode_t mode) /* Overwrite ACL permissions as required by POSIX 1003.1e draft 17. */ aclp[0].a_perm = (mode >> 6) & S_IRWXO; + /* Deliberate deviation from POSIX 1003.1e here. We're not + writing CLASS_OBJ *or* GROUP_OBJ, but both. Otherwise we're + going to be in constant trouble with user expectations. */ + if ((idx = searchace (aclp, nentries, GROUP_OBJ)) >= 0) + aclp[idx].a_perm = (mode >> 3) & S_IRWXO; if (nentries > MIN_ACL_ENTRIES && (idx = searchace (aclp, nentries, CLASS_OBJ)) >= 0) aclp[idx].a_perm = (mode >> 3) & S_IRWXO; - else - aclp[1].a_perm = (mode >> 3) & S_IRWXO; if ((idx = searchace (aclp, nentries, OTHER_OBJ)) >= 0) aclp[idx].a_perm = mode & S_IRWXO; if (pc.isdir ()) diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index ea8563417..170dc1621 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -469,11 +469,14 @@ set_created_file_access (HANDLE handle, path_conv &pc, mode_t attr) /* Overwrite ACL permissions as required by POSIX 1003.1e draft 17. */ aclp[0].a_perm = ((attr & attr_rd) >> 6) & S_IRWXO; + /* Deliberate deviation from POSIX 1003.1e here. We're not + writing CLASS_OBJ *or* GROUP_OBJ, but both. Otherwise we're + going to be in constant trouble with user expectations. */ + if ((idx = searchace (aclp, nentries, GROUP_OBJ)) >= 0) + aclp[idx].a_perm = ((attr & attr_rd) >> 3) & S_IRWXO; if (nentries > MIN_ACL_ENTRIES && (idx = searchace (aclp, nentries, CLASS_OBJ)) >= 0) aclp[idx].a_perm = ((attr & attr_rd) >> 3) & S_IRWXO; - else - aclp[1].a_perm = ((attr & attr_rd) >> 3) & S_IRWXO; if ((idx = searchace (aclp, nentries, OTHER_OBJ)) >= 0) aclp[idx].a_perm = (attr & attr_rd) & S_IRWXO; /* Construct appropriate inherit attribute for new directories. From c14215de386c5e03195c2218a773a32cd4694ccc Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 16 Apr 2015 22:25:23 +0200 Subject: [PATCH 066/109] Fix setting saw_group_obj flag * sec_acl.cc (get_posix_access): Only set saw_group_obj flag if we saw the ACCESS_ALLOWED_ACE. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/sec_acl.cc | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9ec866f2e..bd5ea550a 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-16 Corinna Vinschen + + * sec_acl.cc (get_posix_access): Only set saw_group_obj flag if we saw + the ACCESS_ALLOWED_ACE. + 2015-04-16 Corinna Vinschen * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Deliberatly diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 58683cf9a..1855bb625 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -757,7 +757,8 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, if (owner_eq_group && !saw_group_obj) { type = GROUP_OBJ; - saw_group_obj = true; + if (ace->Header.AceType == ACCESS_ALLOWED_ACE_TYPE) + saw_group_obj = true; } else type = USER; From e26cf1c5d71a4f63eb23a075a555868bdbe3970f Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 16 Apr 2015 22:27:49 +0200 Subject: [PATCH 067/109] Fix merging group perms into owner perms in owner == group case * sec_acl.cc (set_posix_access): Move merging group perms into owner perms in case of owner == group after mask has been computed. Take mask into account when doing so to avoid unnecessary ACCESS_DENIED_ACE. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/sec_acl.cc | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index bd5ea550a..2ecafa0ba 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2015-04-16 Corinna Vinschen + + * sec_acl.cc (set_posix_access): Move merging group perms into owner + perms in case of owner == group after mask has been computed. Take + mask into account when doing so to avoid unnecessary ACCESS_DENIED_ACE. + 2015-04-16 Corinna Vinschen * sec_acl.cc (get_posix_access): Only set saw_group_obj flag if we saw diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 1855bb625..b25e9b337 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -274,11 +274,6 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, tmp_idx = searchace (aclbufp, nentries, def | OTHER_OBJ); other_obj = aclbufp[tmp_idx].a_perm; - /* Do we potentially chmod a file with owner SID == group SID? If so, - make sure the owner perms are always >= group perms. */ - if (!def && owner_eq_group) - aclbufp[0].a_perm |= group_obj; - /* ... class_obj. Create Cygwin ACE. Only the S_ISGID attribute gets inherited. */ access = CYG_ACE_ISBITS_TO_WIN (def ? attr & S_ISGID : attr); @@ -300,6 +295,11 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, inherit)) return NULL; + /* Do we potentially chmod a file with owner SID == group SID? If so, + make sure the owner perms are always >= group perms. */ + if (!def && owner_eq_group) + aclbufp[0].a_perm |= group_obj & class_obj; + /* This loop has two runs, the first w/ check_types == (USER_OBJ | USER), the second w/ check_types == (GROUP_OBJ | GROUP). Each run creates first the deny, then the allow ACEs for the current types. */ From ecc6cfeb7e6d6bb1be8cca563d22c6f8c2c6add1 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 17 Apr 2015 11:56:15 +0200 Subject: [PATCH 068/109] Fix broken PSID problem on cygheap in account handling * pwdgrp.h: Add comment to explain below change. (struct pg_pwd): Convert sid member to BYTE array. (struct pg_grp): Ditto. * grp.cc (pwdgrp::parse_group): Accommodate above change. * passwd.cc (pwdgrp::parse_passwd): Ditto. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/grp.cc | 4 +++- winsup/cygwin/passwd.cc | 4 +++- winsup/cygwin/pwdgrp.h | 8 ++++++-- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 2ecafa0ba..a3402617c 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2015-04-17 Corinna Vinschen + + * pwdgrp.h: Add comment to explain below change. + (struct pg_pwd): Convert sid member to BYTE array. + (struct pg_grp): Ditto. + * grp.cc (pwdgrp::parse_group): Accommodate above change. + * passwd.cc (pwdgrp::parse_passwd): Ditto. + 2015-04-16 Corinna Vinschen * sec_acl.cc (set_posix_access): Move merging group perms into owner diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc index 40e1ca763..f8502100a 100644 --- a/winsup/cygwin/grp.cc +++ b/winsup/cygwin/grp.cc @@ -47,7 +47,9 @@ pwdgrp::parse_group () return false; /* Don't generate gr_mem entries. */ grp.g.gr_mem = &null_ptr; - grp.sid.getfromgr_passwd (&grp.g); + cygsid csid; + csid.getfromgr_passwd (&grp.g); + RtlCopySid (SECURITY_MAX_SID_SIZE, grp.sid, csid); return true; } diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc index 7493aa443..54e429ccf 100644 --- a/winsup/cygwin/passwd.cc +++ b/winsup/cygwin/passwd.cc @@ -40,7 +40,9 @@ pwdgrp::parse_passwd () res.p.pw_gecos = next_str (':'); res.p.pw_dir = next_str (':'); res.p.pw_shell = next_str (':'); - res.sid.getfrompw_gecos (&res.p); + cygsid csid; + csid.getfrompw_gecos (&res.p); + RtlCopySid (SECURITY_MAX_SID_SIZE, res.sid, csid); /* lptr points to the \0 after pw_shell. Increment by one to get the correct required buffer len in getpw_cp. */ res.len = lptr - res.p.pw_name + 1; diff --git a/winsup/cygwin/pwdgrp.h b/winsup/cygwin/pwdgrp.h index a64cb0f5f..80c54c7fe 100644 --- a/winsup/cygwin/pwdgrp.h +++ b/winsup/cygwin/pwdgrp.h @@ -38,17 +38,21 @@ void *setgrent_filtered (int enums, PCWSTR enum_tdoms); void *getgrent_filtered (void *gr); void endgrent_filtered (void *gr); +/* NOTE: The below sid members were cygsid's originally. Don't do that. + cygsid's are pointer based. When adding new entries to the passwd or + group caches, a crealloc call potenitally moves the entries and then + the cygsid pointers point into neverneverland. */ struct pg_pwd { struct passwd p; - cygsid sid; + BYTE sid[SECURITY_MAX_SID_SIZE]; size_t len; }; struct pg_grp { struct group g; - cygsid sid; + BYTE sid[SECURITY_MAX_SID_SIZE]; size_t len; }; From 02bbbb7506709a0a821cdaa9a6ff0f07fb300dad Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 17 Apr 2015 11:57:57 +0200 Subject: [PATCH 069/109] Fix broken SID in passwd/group entry for unkown account * uinfo.cc (pwdgrp::fetch_account_from_windows): Always revert SID subauth count after checking for known domain. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/uinfo.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index a3402617c..fb66f39f3 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-17 Corinna Vinschen + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Always revert SID + subauth count after checking for known domain. + 2015-04-17 Corinna Vinschen * pwdgrp.h: Add comment to explain below change. diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index 6186327b6..bc5f814d0 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -2475,10 +2475,10 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap) posix_offset = fetch_posix_offset (td, &loc_ldap); break; } + sid_sub_auth_count (sid) = sid_sub_auth_count (sid) + 1; } if (domain) { - sid_sub_auth_count (sid) = sid_sub_auth_count (sid) + 1; wcscpy (dom, domain); __small_swprintf (name = namebuf, L"%W(%u)", is_group () ? L"Group" : L"User", From f63dffb818f9856a43ed6cfb3395d882b21d94b8 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 17 Apr 2015 19:54:59 +0200 Subject: [PATCH 070/109] Support acl(2) method for reading pty ACLs, fix pty chown * fhandler.h (fhandler_pty_slave::facl): Add prototype. * fhandler_tty.cc (fhandler_pty_slave::facl): New method. (fhandler_pty_slave::fchown): Fix uid/gid handling. * sec_acl.cc (set_posix_access): Drop superfluous class_idx variable. Simplify and move around code in a few places. To improve ACL readability, add r/w permissions to Admins ACE appended to pty ACL. Add comment to explain Windows ACE Mask filtering being in the way of creating a real CLASS_OBJ. (get_posix_access): Fake CLASS_OBJ for ptys. Explain why. * security.cc (get_object_attribute): Add S_IFCHR flag to attributes when calling get_posix_access. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 14 ++++++++ winsup/cygwin/fhandler.h | 1 + winsup/cygwin/fhandler_tty.cc | 64 +++++++++++++++++++++++++++++++++-- winsup/cygwin/sec_acl.cc | 56 +++++++++++++++++++----------- winsup/cygwin/security.cc | 9 +++-- 5 files changed, 120 insertions(+), 24 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index fb66f39f3..04bd520d8 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,17 @@ +2015-04-17 Corinna Vinschen + + * fhandler.h (fhandler_pty_slave::facl): Add prototype. + * fhandler_tty.cc (fhandler_pty_slave::facl): New method. + (fhandler_pty_slave::fchown): Fix uid/gid handling. + * sec_acl.cc (set_posix_access): Drop superfluous class_idx variable. + Simplify and move around code in a few places. To improve ACL + readability, add r/w permissions to Admins ACE appended to pty ACL. + Add comment to explain Windows ACE Mask filtering being in the way of + creating a real CLASS_OBJ. + (get_posix_access): Fake CLASS_OBJ for ptys. Explain why. + * security.cc (get_object_attribute): Add S_IFCHR flag to attributes + when calling get_posix_access. + 2015-04-17 Corinna Vinschen * uinfo.cc (pwdgrp::fetch_account_from_windows): Always revert SID diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 694c23bdd..05269e59b 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -1545,6 +1545,7 @@ class fhandler_pty_slave: public fhandler_pty_common select_record *select_read (select_stuff *); virtual char const *ttyname () { return pc.dev.name; } int __reg2 fstat (struct stat *buf); + int __reg3 facl (int, int, struct acl *); int __reg1 fchmod (mode_t mode); int __reg2 fchown (uid_t uid, gid_t gid); diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index ccb76d90e..d243d515a 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -12,6 +12,7 @@ details. */ #include "winsup.h" #include #include +#include #include #include "cygerrno.h" #include "security.h" @@ -1018,6 +1019,62 @@ fhandler_pty_slave::fstat (struct stat *st) return 0; } +int __reg3 +fhandler_pty_slave::facl (int cmd, int nentries, aclent_t *aclbufp) +{ + int res = -1; + bool to_close = false; + security_descriptor sd; + mode_t attr = S_IFCHR; + + switch (cmd) + { + case SETACL: + if (!aclsort32 (nentries, 0, aclbufp)) + set_errno (ENOTSUP); + break; + case GETACL: + if (!aclbufp) + { + set_errno (EFAULT); + break; + } + /*FALLTHRU*/ + case GETACLCNT: + if (!input_available_event) + { + char buf[MAX_PATH]; + shared_name (buf, INPUT_AVAILABLE_EVENT, get_minor ()); + input_available_event = OpenEvent (READ_CONTROL, TRUE, buf); + if (input_available_event) + to_close = true; + } + if (!input_available_event + || get_object_sd (input_available_event, sd)) + { + res = get_posix_access (NULL, &attr, NULL, NULL, aclbufp, nentries); + if (aclbufp && res == MIN_ACL_ENTRIES) + { + aclbufp[0].a_perm = S_IROTH | S_IWOTH; + aclbufp[0].a_id = 18; + aclbufp[1].a_id = 544; + } + break; + } + if (cmd == GETACL) + res = get_posix_access (sd, &attr, NULL, NULL, aclbufp, nentries); + else + res = get_posix_access (sd, &attr, NULL, NULL, NULL, 0); + break; + default: + set_errno (EINVAL); + break; + } + if (to_close) + CloseHandle (input_available_event); + return res; +} + /* Helper function for fchmod and fchown, which just opens all handles and signals success via bool return. */ bool @@ -1122,8 +1179,11 @@ fhandler_pty_slave::fchown (uid_t uid, gid_t gid) RtlCreateSecurityDescriptor (sd, SECURITY_DESCRIPTOR_REVISION); if (!get_object_attribute (input_available_event, &o_uid, &o_gid, &mode)) { - if ((uid == ILLEGAL_UID || uid == o_uid) - && (gid == ILLEGAL_GID || gid == o_gid)) + if (uid == ILLEGAL_UID) + uid = o_uid; + if (gid == ILLEGAL_GID) + gid = o_gid; + if (uid == o_uid && gid == o_gid) ret = 0; else if (!create_object_sd_from_attribute (uid, gid, mode, sd)) ret = fch_set_sd (sd, true); diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index b25e9b337..9336dea35 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -140,9 +140,9 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, size_t acl_len = sizeof (ACL); mode_t class_obj = 0, other_obj, group_obj, deny; DWORD access; - int idx, start_idx, class_idx, tmp_idx; + int idx, start_idx, tmp_idx; bool owner_eq_group = false; - bool dev_saw_admins = false; + bool dev_has_admins = false; /* Initialize local security descriptor. */ RtlCreateSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION); @@ -172,8 +172,9 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, return NULL; } owner_eq_group = RtlEqualSid (owner, group); - - + if (S_ISCHR (attr)) + dev_has_admins = well_known_admins_sid == owner + || well_known_admins_sid == group; /* No POSIX ACL? Use attr to generate one from scratch. */ if (!aclbufp) @@ -276,11 +277,12 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, /* ... class_obj. Create Cygwin ACE. Only the S_ISGID attribute gets inherited. */ - access = CYG_ACE_ISBITS_TO_WIN (def ? attr & S_ISGID : attr); - class_idx = searchace (aclbufp, nentries, def | CLASS_OBJ); - if (class_idx >= 0) + access = CYG_ACE_ISBITS_TO_WIN (def ? attr & S_ISGID : attr) + | CYG_ACE_NEW_STYLE; + tmp_idx = searchace (aclbufp, nentries, def | CLASS_OBJ); + if (tmp_idx >= 0) { - class_obj = aclbufp[class_idx].a_perm; + class_obj = aclbufp[tmp_idx].a_perm; access |= CYG_ACE_MASK_TO_WIN (class_obj); } else @@ -288,9 +290,11 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, /* Setting class_obj to group_obj allows to write below code without additional checks for existence of a CLASS_OBJ. */ class_obj = group_obj; - class_idx = -1; } - access |= CYG_ACE_NEW_STYLE; + /* Note that Windows filters the ACE Mask value so it only reflects + the bit values supported by the object type. The result is that + we can't set a CLASS_OBJ value for ptys. The get_posix_access + function has to workaround that. */ if (!add_access_denied_ace (acl, access, well_known_null_sid, acl_len, inherit)) return NULL; @@ -359,14 +363,6 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, if (aclbufp[idx].a_perm == S_IRWXO) access |= FILE_DELETE_CHILD; } - /* For ptys check if the admins group is in the ACL. If so, - make sure the group has WRITE_DAC and WRITE_OWNER perms. */ - if (S_ISCHR (attr) && !dev_saw_admins - && aclsid[idx] == well_known_admins_sid) - { - access |= STD_RIGHTS_OWNER; - dev_saw_admins = true; - } if (aclbufp[idx].a_perm & S_IROTH) access |= FILE_ALLOW_READ; if (aclbufp[idx].a_perm & S_IWOTH) @@ -379,6 +375,10 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, == (S_IWOTH | S_IXOTH) && (!(attr & S_ISVTX) || aclbufp[idx].a_type & USER_OBJ)) access |= FILE_DELETE_CHILD; + /* For ptys, make sure the Administrators group has WRITE_DAC + and WRITE_OWNER perms. */ + if (dev_has_admins && aclsid[idx] == well_known_admins_sid) + access |= STD_RIGHTS_OWNER; if (!add_access_allowed_ace (acl, access, aclsid[idx], acl_len, inherit)) return NULL; @@ -386,8 +386,10 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, } /* For ptys if the admins group isn't in the ACL, add an ACE to make sure the group has WRITE_DAC and WRITE_OWNER perms. */ - if (S_ISCHR (attr) && !dev_saw_admins - && !add_access_allowed_ace (acl, STD_RIGHTS_OWNER, + if (S_ISCHR (attr) && !dev_has_admins + && !add_access_allowed_ace (acl, + STD_RIGHTS_OWNER | FILE_ALLOW_READ + | FILE_ALLOW_WRITE, well_known_admins_sid, acl_len, NO_INHERITANCE)) return NULL; @@ -860,6 +862,20 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, lacl[pos].a_id = ILLEGAL_GID; lacl[pos].a_perm = class_perm | lacl[1].a_perm; } + /* For ptys, fake a mask if the admins group is neither owner nor group. + In that case we have an extra ACE for the admins group, and we need a + CLASS_OBJ to get a valid POSIX ACL. However, Windows filters the ACE + Mask value so it only reflects the bit values supported by the object + type. The result is that we can't set an explicit CLASS_OBJ value for + ptys in the NULL SID ACE. */ + else if (S_ISCHR (attr) && owner_sid != well_known_admins_sid + && group_sid != well_known_admins_sid + && (pos = searchace (lacl, MAX_ACL_ENTRIES, CLASS_OBJ)) >= 0) + { + lacl[pos].a_type = CLASS_OBJ; + lacl[pos].a_id = ILLEGAL_GID; + lacl[pos].a_perm = lacl[1].a_perm; /* == group perms */ + } /* If this is a just created file, and there are no default permissions (probably no inherited ACEs so created from a default DACL), assign the permissions specified by the file creation mask. The values get diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 170dc1621..6d891c1ac 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -401,11 +401,16 @@ get_object_attribute (HANDLE handle, uid_t *uidret, gid_t *gidret, mode_t *attribute) { security_descriptor sd; + mode_t attr = S_IFCHR; if (get_object_sd (handle, sd)) return -1; - return get_posix_access (sd, attribute, uidret, gidret, NULL, 0) >= 0 - ? 0 : -1; + if (attribute) + *attribute |= S_IFCHR; + else + attribute = &attr; + return get_posix_access (sd, attribute, uidret, gidret, NULL, 0) + >= 0 ? 0 : -1; } int From 2e950b1edd5615bd145f2eaa99f03db4c998ed15 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 18 Apr 2015 17:07:08 +0200 Subject: [PATCH 071/109] Try to avoid creating dangerous DENY ACEs * sec_acl.cc (set_posix_access): Don't create DENY ACEs for USER and GROUP entries if they are the same as USER_OBJ or GROUP_OBJ. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/sec_acl.cc | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 04bd520d8..a19a9e9e5 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-17 Corinna Vinschen + + * sec_acl.cc (set_posix_access): Don't create DENY ACEs for USER and + GROUP entries if they are the same as USER_OBJ or GROUP_OBJ. + 2015-04-17 Corinna Vinschen * fhandler.h (fhandler_pty_slave::facl): Add prototype. diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 9336dea35..7e6507736 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -316,6 +316,12 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, idx < nentries && aclbufp[idx].a_type & check_types; ++idx) { + /* Avoid to create DENY ACEs for the second orrurence of + accounts which show up twice, as USER_OBJ and USER, or + GROUP_OBJ and GROUP. */ + if ((aclbufp[idx].a_type & USER && aclsid[idx] == owner) + || (aclbufp[idx].a_type & GROUP && aclsid[idx] == group)) + continue; /* For the rules how to construct the deny access mask, see the comment right at the start of this file. */ if (aclbufp[idx].a_type & USER_OBJ) From a024aa2f8fc402de5fdd49431a6329481cd84395 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 20 Apr 2015 10:12:24 +0200 Subject: [PATCH 072/109] sec_acl.cc (set_posix_access): Fix typo in comment Signed-off-by: Corinna Vinschen --- winsup/cygwin/sec_acl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 7e6507736..65b31315c 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -316,7 +316,7 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, idx < nentries && aclbufp[idx].a_type & check_types; ++idx) { - /* Avoid to create DENY ACEs for the second orrurence of + /* Avoid creating DENY ACEs for the second occurrence of accounts which show up twice, as USER_OBJ and USER, or GROUP_OBJ and GROUP. */ if ((aclbufp[idx].a_type & USER && aclsid[idx] == owner) From 2f5e8337353c4a5c4f6e6bb1e03383177a1e5855 Mon Sep 17 00:00:00 2001 From: David Macek Date: Sat, 18 Apr 2015 23:25:15 +0200 Subject: [PATCH 073/109] Fix inconsistencies in docs regarding fstab and executable file detection The inline list of mount options seemed redundant, so the paragraph now points to the list below it. List of executable extensions updated according to fhandler_disk_file.cc. List of executable magic numbers updated according to path.h (has_exec_chars). * pathnames.xml: Fix inconsistencies in docs regarding fstab and executable file detection Signed-off-by: Corinna Vinschen --- winsup/doc/pathnames.xml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/winsup/doc/pathnames.xml b/winsup/doc/pathnames.xml index 00eb133e7..cdbf9fad6 100644 --- a/winsup/doc/pathnames.xml +++ b/winsup/doc/pathnames.xml @@ -81,9 +81,8 @@ see The fourth field describes the mount options associated with the filesystem. It is formatted as a comma separated list of options. It contains at least the type of mount (binary or text) plus -any additional options appropriate to the filesystem type. Recognized -options are binary, text, nouser, user, exec, notexec, cygexec, nosuid, -posix=[0|1]. The meaning of the options is as follows. +any additional options appropriate to the filesystem type. The list of +the options, including their meaning, follows. acl - Cygwin uses the filesystem's access control lists (ACLs) to @@ -136,14 +135,14 @@ executability, this is not possible on filesystems which don't support permissions at all (like FAT/FAT32), or if ACLs are ignored on filesystems supporting them (see the aforementioned acl mount option). In these cases, the following heuristic is used to evaluate if a file is -executable: Files ending in certain extensions (.exe, .com, .bat, .btm, -.cmd) are assumed to be executable. Files whose first two characters begin -with '#!' are also considered to be executable. +executable: Files ending in certain extensions (.exe, .com, .lnk) are +assumed to be executable. Files whose first two characters are "#!", "MZ", +or ":\n" are also considered to be executable. The exec option is used to instruct Cygwin that the mounted file is "executable". If the exec option is used with a directory then all files in the directory are executable. This option allows other files to be marked as executable and avoids the -overhead of opening each file to check for a '#!'. The +overhead of opening each file to check for "magic" bytes. The cygexec option is very similar to exec, but also prevents Cygwin from setting up commands and environment variables for a normal Windows program, adding another small performance gain. The From b364582734085ab498dcf75c2f4538d0c4253234 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 20 Apr 2015 12:06:05 +0200 Subject: [PATCH 074/109] Apply mask execute bit for SYSTEM and Admins group. * sec_acl.cc (set_posix_access): Apply mask only in terms of execute bit for SYSTEM and Admins group. * getfacl.c (main): Special-case SYSTEM and Admins group. Add comments. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/sec_acl.cc | 12 +++++++----- winsup/utils/ChangeLog | 4 ++++ winsup/utils/getfacl.c | 20 ++++++++++++++++++-- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index a19a9e9e5..dda1a9563 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-20 Corinna Vinschen + + * sec_acl.cc (set_posix_access): Apply mask only in terms of execute bit + for SYSTEM and Admins group. + 2015-04-17 Corinna Vinschen * sec_acl.cc (set_posix_access): Don't create DENY ACEs for USER and diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 65b31315c..bddd21c54 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -329,16 +329,18 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid, else if (aclbufp[idx].a_type & USER) deny = (aclbufp[idx].a_perm ^ class_obj) | (~aclbufp[idx].a_perm & other_obj); + /* Accommodate Windows: Only generate deny masks for SYSTEM + and the Administrators group in terms of the execute bit, + if they are not the primary group. */ + else if (aclbufp[idx].a_type & GROUP + && (aclsid[idx] == well_known_system_sid + || aclsid[idx] == well_known_admins_sid)) + deny = aclbufp[idx].a_perm & ~(class_obj | S_IROTH | S_IWOTH); else deny = (aclbufp[idx].a_perm & ~class_obj) | (~aclbufp[idx].a_perm & other_obj); if (!deny) continue; - /* Accommodate Windows: Never generate deny masks for SYSTEM - and the Administrators group. */ - if (aclsid[idx] == well_known_system_sid - || aclsid[idx] == well_known_admins_sid) - continue; access = 0; if (deny & S_IROTH) access |= FILE_DENY_READ; diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index a48f8693f..b37792ab3 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,7 @@ +2015-04-20 Corinna Vinschen + + * getfacl.c (main): Special-case SYSTEM and Admins group. Add comments. + 2015-04-16 Corinna Vinschen * setfacl.c: Align more to Linux tool. diff --git a/winsup/utils/getfacl.c b/winsup/utils/getfacl.c index 07d8a8a9f..45e5e2090 100644 --- a/winsup/utils/getfacl.c +++ b/winsup/utils/getfacl.c @@ -279,16 +279,32 @@ main (int argc, char **argv) { case USER: case GROUP_OBJ: - case GROUP: effective = acls[i].a_perm & mask; print_effective = 1; break; + case GROUP: + /* Special case SYSTEM and Admins group: The mask only + applies to them as far as the execute bit is concerned. */ + if (acls[i].a_id == 18 || acls[i].a_id == 544) + effective = acls[i].a_perm & (mask | S_IROTH | S_IWOTH); + else + effective = acls[i].a_perm & mask; + print_effective = 1; + break; case DEF_USER: case DEF_GROUP_OBJ: - case DEF_GROUP: effective = acls[i].a_perm & def_mask; print_effective = 1; break; + case DEF_GROUP: + /* Special case SYSTEM and Admins group: The mask only + applies to them as far as the execute bit is concerned. */ + if (acls[i].a_id == 18 || acls[i].a_id == 544) + effective = acls[i].a_perm & (def_mask | S_IROTH | S_IWOTH); + else + effective = acls[i].a_perm & def_mask; + print_effective = 1; + break; } if (print_effective && eopt >= 0 && (eopt > 0 || effective != acls[i].a_perm)) From a8ec1e804ee9ba2d6f8304731e593dcf167c9836 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 21 Apr 2015 11:49:38 +0200 Subject: [PATCH 075/109] Apply umask on "standard" Cygwin ACL * sec_acl.cc (get_posix_access): Check for Cygwin "standard" ACL. Apply umask, if so. Align comments. * security.cc (set_created_file_access): Fix permission masking by incoming requested file mode. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/sec_acl.cc | 28 ++++++++++++++++++-------- winsup/cygwin/security.cc | 42 +++++++++++++++++++++++++-------------- 3 files changed, 54 insertions(+), 23 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index dda1a9563..998cb4b20 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2015-04-21 Corinna Vinschen + + * sec_acl.cc (get_posix_access): Check for Cygwin "standard" ACL. + Apply umask, if so. Align comments. + * security.cc (set_created_file_access): Fix permission masking by + incoming requested file mode. + 2015-04-20 Corinna Vinschen * sec_acl.cc (set_posix_access): Apply mask only in terms of execute bit diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index bddd21c54..7d97fca02 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -549,6 +549,7 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, bool owner_eq_group; bool just_created = false; + bool standard_ACEs_only = true; bool new_style = false; bool saw_user_obj = false; bool saw_group_obj = false; @@ -802,6 +803,17 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, class_perm |= lacl[pos].a_perm; } } + /* For a newly created file, we'd like to know if we're running + with a standard ACL, one only consisting of POSIX perms, plus + SYSTEM and Admins as maximum non-POSIX perms entries. If it's + a standard ACL, we apply umask. That's not entirely correct, + but it's probably the best we can do. */ + else if (type & (USER | GROUP) + && just_created + && standard_ACEs_only + && ace_sid != well_known_system_sid + && ace_sid != well_known_admins_sid) + standard_ACEs_only = false; } } if ((ace->Header.AceFlags & SUB_CONTAINERS_AND_OBJECTS_INHERIT)) @@ -884,19 +896,19 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, lacl[pos].a_id = ILLEGAL_GID; lacl[pos].a_perm = lacl[1].a_perm; /* == group perms */ } - /* If this is a just created file, and there are no default permissions - (probably no inherited ACEs so created from a default DACL), assign - the permissions specified by the file creation mask. The values get - masked by the actually requested permissions by the caller. - See POSIX 1003.1e draft 17. */ + /* If this is a just created file, and this is an ACL with only standard + entries, or if standard POSIX permissions are missing (probably no + inherited ACEs so created from a default DACL), assign the permissions + specified by the file creation mask. The values get masked by the + actually requested permissions by the caller per POSIX 1003.1e draft 17. */ if (just_created) { mode_t perms = (S_IRWXU | S_IRWXG | S_IRWXO) & ~cygheap->umask; - if (!saw_user_obj) + if (standard_ACEs_only || !saw_user_obj) lacl[0].a_perm = (perms >> 6) & S_IRWXO; - if (!saw_group_obj) + if (standard_ACEs_only || !saw_group_obj) lacl[1].a_perm = (perms >> 3) & S_IRWXO; - if (!saw_other_obj) + if (standard_ACEs_only || !saw_other_obj) lacl[2].a_perm = perms & S_IRWXO; } /* Ensure that the default acl contains at least diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 6d891c1ac..5fca6746e 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -468,22 +468,34 @@ set_created_file_access (HANDLE handle, path_conv &pc, mode_t attr) if ((nentries = get_posix_access (sd, &attr_rd, &uid, &gid, aclp, MAX_ACL_ENTRIES)) >= 0) { - /* Symlinks always get the request POSIX perms. */ if (S_ISLNK (attr)) - attr_rd = 0777; - /* Overwrite ACL permissions as required by POSIX 1003.1e - draft 17. */ - aclp[0].a_perm = ((attr & attr_rd) >> 6) & S_IRWXO; - /* Deliberate deviation from POSIX 1003.1e here. We're not - writing CLASS_OBJ *or* GROUP_OBJ, but both. Otherwise we're - going to be in constant trouble with user expectations. */ - if ((idx = searchace (aclp, nentries, GROUP_OBJ)) >= 0) - aclp[idx].a_perm = ((attr & attr_rd) >> 3) & S_IRWXO; - if (nentries > MIN_ACL_ENTRIES - && (idx = searchace (aclp, nentries, CLASS_OBJ)) >= 0) - aclp[idx].a_perm = ((attr & attr_rd) >> 3) & S_IRWXO; - if ((idx = searchace (aclp, nentries, OTHER_OBJ)) >= 0) - aclp[idx].a_perm = (attr & attr_rd) & S_IRWXO; + { + /* Symlinks always get the request POSIX perms. */ + aclp[0].a_perm = (attr >> 6) & S_IRWXO; + if ((idx = searchace (aclp, nentries, GROUP_OBJ)) >= 0) + aclp[idx].a_perm = (attr >> 3) & S_IRWXO; + if (nentries > MIN_ACL_ENTRIES + && (idx = searchace (aclp, nentries, CLASS_OBJ)) >= 0) + aclp[idx].a_perm = (attr >> 3) & S_IRWXO; + if ((idx = searchace (aclp, nentries, OTHER_OBJ)) >= 0) + aclp[idx].a_perm = attr & S_IRWXO; + } + else + { + /* Overwrite ACL permissions as required by POSIX 1003.1e + draft 17. */ + aclp[0].a_perm &= (attr >> 6) & S_IRWXO; + /* Deliberate deviation from POSIX 1003.1e here. We're not + writing CLASS_OBJ *or* GROUP_OBJ, but both. Otherwise we're + going to be in constant trouble with user expectations. */ + if ((idx = searchace (aclp, nentries, GROUP_OBJ)) >= 0) + aclp[idx].a_perm &= (attr >> 3) & S_IRWXO; + if (nentries > MIN_ACL_ENTRIES + && (idx = searchace (aclp, nentries, CLASS_OBJ)) >= 0) + aclp[idx].a_perm &= (attr >> 3) & S_IRWXO; + if ((idx = searchace (aclp, nentries, OTHER_OBJ)) >= 0) + aclp[idx].a_perm &= attr & S_IRWXO; + } /* Construct appropriate inherit attribute for new directories. Basically we do this only for the sake of non-Cygwin applications. Cygwin applications don't need these. Additionally, if the From 496d50d75e34575f9800170056b410e16185c547 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 21 Apr 2015 14:29:01 +0200 Subject: [PATCH 076/109] Asia/Calcutta -> Asia/Kolkata (not on unicode.org) * tzmap-from-unicode.org: Convert Calcutta to Kolkata. * tzmap.h: Regenerate. Signed-off-by: Corinna Vinschen --- winsup/utils/ChangeLog | 5 +++++ winsup/utils/tzmap-from-unicode.org | 1 + winsup/utils/tzmap.h | 11 +++++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index b37792ab3..a0fd0701c 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,8 @@ +2015-04-21 Corinna Vinschen + + * tzmap-from-unicode.org: Convert Calcutta to Kolkata. + * tzmap.h: Regenerate. + 2015-04-20 Corinna Vinschen * getfacl.c (main): Special-case SYSTEM and Admins group. Add comments. diff --git a/winsup/utils/tzmap-from-unicode.org b/winsup/utils/tzmap-from-unicode.org index a155312a8..e169ee7a7 100755 --- a/winsup/utils/tzmap-from-unicode.org +++ b/winsup/utils/tzmap-from-unicode.org @@ -64,6 +64,7 @@ echo "{" wget -O - "${ZONES_FILE}" | \ { sed -n -e 's#territory="001"#territory=""# + s#Asia/Calcutta#Asia/Kolkata# s#.*mapZone other=\("[^"]*"\) territory=\("[^"]*"\) type=\("[^"]*"\).*# { L\1, L\2, L\3 },#p' echo ' { L"Armenian Standard Time", L"AM", L"Asia/Yerevan" },' echo ' { L"Central Europe Standard Time", L"CS", L"Europe/Belgrade" },' diff --git a/winsup/utils/tzmap.h b/winsup/utils/tzmap.h index dd4f8c0e4..31a83c96d 100644 --- a/winsup/utils/tzmap.h +++ b/winsup/utils/tzmap.h @@ -134,6 +134,7 @@ struct { L"Central Pacific Standard Time", L"AU", L"Antarctica/Macquarie" }, { L"Central Pacific Standard Time", L"FM", L"Pacific/Ponape Pacific/Kosrae" }, { L"Central Pacific Standard Time", L"NC", L"Pacific/Noumea" }, + { L"Central Pacific Standard Time", L"PG", L"Pacific/Bougainville" }, { L"Central Pacific Standard Time", L"SB", L"Pacific/Guadalcanal" }, { L"Central Pacific Standard Time", L"VU", L"Pacific/Efate" }, { L"Central Pacific Standard Time", L"ZZ", L"Etc/GMT-11" }, @@ -143,7 +144,7 @@ struct { L"Central Standard Time", L"US", L"America/Chicago America/Indiana/Knox America/Indiana/Tell_City America/Menominee America/North_Dakota/Beulah America/North_Dakota/Center America/North_Dakota/New_Salem" }, { L"Central Standard Time", L"ZZ", L"CST6CDT" }, { L"Central Standard Time (Mexico)", L"", L"America/Mexico_City" }, - { L"Central Standard Time (Mexico)", L"MX", L"America/Mexico_City America/Bahia_Banderas America/Cancun America/Merida America/Monterrey" }, + { L"Central Standard Time (Mexico)", L"MX", L"America/Mexico_City America/Bahia_Banderas America/Merida America/Monterrey" }, { L"China Standard Time", L"", L"Asia/Shanghai" }, { L"China Standard Time", L"CN", L"Asia/Shanghai" }, { L"China Standard Time", L"HK", L"Asia/Hong_Kong" }, @@ -179,6 +180,8 @@ struct { L"Eastern Standard Time", L"TC", L"America/Grand_Turk" }, { L"Eastern Standard Time", L"US", L"America/New_York America/Detroit America/Indiana/Petersburg America/Indiana/Vincennes America/Indiana/Winamac America/Kentucky/Monticello America/Louisville" }, { L"Eastern Standard Time", L"ZZ", L"EST5EDT" }, + { L"Eastern Standard Time (Mexico)", L"", L"America/Cancun" }, + { L"Eastern Standard Time (Mexico)", L"MX", L"America/Cancun" }, { L"Egypt Standard Time", L"", L"Africa/Cairo" }, { L"Egypt Standard Time", L"EG", L"Africa/Cairo" }, { L"Egypt Standard Time", L"PS", L"Asia/Gaza Asia/Hebron" }, @@ -236,8 +239,8 @@ struct { L"Hawaiian Standard Time", L"UM", L"Pacific/Johnston" }, { L"Hawaiian Standard Time", L"US", L"Pacific/Honolulu" }, { L"Hawaiian Standard Time", L"ZZ", L"Etc/GMT+10" }, - { L"India Standard Time", L"", L"Asia/Calcutta" }, - { L"India Standard Time", L"IN", L"Asia/Calcutta" }, + { L"India Standard Time", L"", L"Asia/Kolkata" }, + { L"India Standard Time", L"IN", L"Asia/Kolkata" }, { L"Iran Standard Time", L"", L"Asia/Tehran" }, { L"Iran Standard Time", L"IR", L"Asia/Tehran" }, { L"Israel Standard Time", L"", L"Asia/Jerusalem" }, @@ -507,7 +510,7 @@ struct { L"West Pacific Standard Time", L"FM", L"Pacific/Truk" }, { L"West Pacific Standard Time", L"GU", L"Pacific/Guam" }, { L"West Pacific Standard Time", L"MP", L"Pacific/Saipan" }, - { L"West Pacific Standard Time", L"PG", L"Pacific/Port_Moresby Pacific/Bougainville" }, + { L"West Pacific Standard Time", L"PG", L"Pacific/Port_Moresby" }, { L"West Pacific Standard Time", L"ZZ", L"Etc/GMT-10" }, { L"Yakutsk Standard Time", L"", L"Asia/Yakutsk" }, { L"Yakutsk Standard Time", L"RU", L"Asia/Yakutsk Asia/Khandyga" }, From b02faccae49f162a4d5b7638a27343e00a34a7dd Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 21 Apr 2015 14:51:30 +0200 Subject: [PATCH 077/109] Remove Cygwin's libgen.h * include/libgen.h: Remove in favor of newlib version. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/include/libgen.h | 23 ----------------------- 2 files changed, 4 insertions(+), 23 deletions(-) delete mode 100644 winsup/cygwin/include/libgen.h diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 998cb4b20..774828faf 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2015-04-21 Corinna Vinschen + + * include/libgen.h: Remove in favor of newlib version. + 2015-04-21 Corinna Vinschen * sec_acl.cc (get_posix_access): Check for Cygwin "standard" ACL. diff --git a/winsup/cygwin/include/libgen.h b/winsup/cygwin/include/libgen.h deleted file mode 100644 index f5c24a8cc..000000000 --- a/winsup/cygwin/include/libgen.h +++ /dev/null @@ -1,23 +0,0 @@ -/* libgen.h - - Copyright 2005 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -#ifndef _LIBGEN_H -#define _LIBGEN_H - -#include - -__BEGIN_DECLS - -extern char *basename (char *path); -extern char *dirname (char *path); - -__END_DECLS - -#endif /* _LIBGEN_H */ From 57346de226846d3ebe91024297add2eded2d2fe2 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 21 Apr 2015 01:34:24 -0400 Subject: [PATCH 078/109] libgloss: arm: fix copy & paste in syscall.h This header was clearly copied from the common syscall.h and customized, but the header comment is no longer accurate -- this isn't the general file anymore. --- libgloss/ChangeLog | 4 ++++ libgloss/arm/syscall.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 37cb4a581..f2bdc0d7c 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,7 @@ +2015-04-21 Mike Frysinger + + * arm/syscall.h: Adjust comment header. + 2015-04-09 Nick Clifton * rx/crt0.S (_start): If string instructions are not allowed, diff --git a/libgloss/arm/syscall.h b/libgloss/arm/syscall.h index 759801f4f..21e3801db 100644 --- a/libgloss/arm/syscall.h +++ b/libgloss/arm/syscall.h @@ -1,6 +1,6 @@ -/* General use syscall.h file. - The more ports that use this file, the simpler sim/common/nltvals.def - remains. */ +/* arm syscall.h file. This is used only by the simulator. This includes + a few extra needed by RedBoot, but is otherwise a copy of the + libgloss/syscall.h file. */ #ifndef LIBGLOSS_SYSCALL_H #define LIBGLOSS_SYSCALL_H From 8154d0d4ca4033d30e65cf30ff78d4fbc4ed2091 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 21 Apr 2015 01:36:00 -0400 Subject: [PATCH 079/109] libgloss: mcore: add custom syscall header The mcore simulator has a unique set of syscall numbers. Add a header that matches reality since the common one doesn't. --- libgloss/ChangeLog | 4 ++++ libgloss/mcore/syscall.h | 43 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 libgloss/mcore/syscall.h diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index f2bdc0d7c..a47d78dbd 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,7 @@ +2015-04-21 Mike Frysinger + + * mcore/syscall.h: New header. + 2015-04-21 Mike Frysinger * arm/syscall.h: Adjust comment header. diff --git a/libgloss/mcore/syscall.h b/libgloss/mcore/syscall.h new file mode 100644 index 000000000..e204f0c5e --- /dev/null +++ b/libgloss/mcore/syscall.h @@ -0,0 +1,43 @@ +/* syscall.h for the mcore processor. It matches the syscalls.S file which + matches the GNU simulator. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Rolls-Royce Controls and Data Services Limited nor + the names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + THE POSSIBILITY OF SUCH DAMAGE. */ + +#ifndef LIBGLOSS_SYSCALL_H +#define LIBGLOSS_SYSCALL_H + +#define SYS_read 3 +#define SYS_write 4 +#define SYS_open 5 +#define SYS_close 6 +#define SYS_creat 8 +#define SYS_link 9 +#define SYS_unlink 10 +#define SYS_time 13 +#define SYS_lseek 19 +#define SYS_access 33 +#define SYS_times 43 + +#endif From 84e4cb880afd04de3693a7b61f53aa91c575b101 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 22 Apr 2015 10:05:16 +0200 Subject: [PATCH 080/109] Fix basename prototype collision string.h vs libgen.h * libc/include/libgen.h (basename): Drop defining _BASENAME_DEFINED. Always define macro basename. Add comment to explain why. * libc/include/string.h (basename): Check for basename instead of _BASENAME_DEFINED. Drop __GNUC__ branch, always use basename macro. Change comment to explain why. Add nonnull function attribute. Signed-off-by: Corinna Vinschen --- newlib/ChangeLog | 8 ++++++++ newlib/libc/include/libgen.h | 14 +++++++++++++- newlib/libc/include/string.h | 24 +++++++++++++----------- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index bca127755..edf4a7fce 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,11 @@ +2015-04-22 Corinna Vinschen + + * libc/include/libgen.h (basename): Drop defining _BASENAME_DEFINED. + Always define macro basename. Add comment to explain why. + * libc/include/string.h (basename): Check for basename instead of + _BASENAME_DEFINED. Drop __GNUC__ branch, always use basename macro. + Change comment to explain why. Add nonnull function attribute. + 2015-04-09 Nick Clifton * libc/machine/rx/memchr.S: Add non-string insn using version. diff --git a/newlib/libc/include/libgen.h b/newlib/libc/include/libgen.h index 8360a22f9..de70b5b2f 100644 --- a/newlib/libc/include/libgen.h +++ b/newlib/libc/include/libgen.h @@ -12,8 +12,20 @@ extern "C" { #endif +/* There are two common basename variants. If you do NOT #include + and you do + + #define _GNU_SOURCE + #include + + you get the GNU version. Otherwise you get the POSIX versionfor which you + should #include i for the function prototype. POSIX requires that + #undef basename will still let you invoke the underlying function. However, + this also implies that the POSIX version is used in this case. That's made + sure here. */ +#undef basename +#define basename basename char *_EXFUN(basename, (char *)); -#define _BASENAME_DEFINED char *_EXFUN(dirname, (char *)); #ifdef __cplusplus diff --git a/newlib/libc/include/string.h b/newlib/libc/include/string.h index 9e11e5c51..92e08aebc 100644 --- a/newlib/libc/include/string.h +++ b/newlib/libc/include/string.h @@ -163,18 +163,20 @@ int _EXFUN(strtosigno, (const char *__name)); (char *) memcpy (__out, __in, __len-1);})) #endif /* _GNU_SOURCE && __GNUC__ */ -/* There are two common basename variants. If you #include - first, you get the POSIX version; otherwise you get the GNU version. - POSIX requires that #undef basename will still let you - invoke the underlying function, but that requires gcc support. */ -#if __GNU_VISIBLE && !defined(_BASENAME_DEFINED) -# ifdef __GNUC__ -char *_EXFUN(basename,(const char *)) - __asm__ (__ASMNAME ("__gnu_basename")) __nonnull(1); -# else -char *_EXFUN(__gnu_basename,(const char *)); +/* There are two common basename variants. If you do NOT #include + and you do + + #define _GNU_SOURCE + #include + + you get the GNU version. Otherwise you get the POSIX versionfor which you + should #include i for the function prototype. POSIX requires that + #undef basename will still let you invoke the underlying function. However, + this also implies that the POSIX version is used in this case. That's made + sure here. */ +#if __GNU_VISIBLE && !defined(basename) +char *_EXFUN(__nonnull (1) __gnu_basename,(const char *)); # define basename __gnu_basename -# endif #endif #include From 3d96fa70720a2b08c553bde7171bf943cd585d84 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 22 Apr 2015 10:55:26 +0200 Subject: [PATCH 081/109] Undef basename before defining function. * path.cc (basename): Undefine basename before defining function to avoid type collision with prototype in string.h. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/path.cc | 2 ++ 2 files changed, 7 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 774828faf..589e0c70a 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-22 Corinna Vinschen + + * path.cc (basename): Undefine basename before defining function to + avoid type collision with prototype in string.h. + 2015-04-21 Corinna Vinschen * include/libgen.h: Remove in favor of newlib version. diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 5439a161a..ea5595698 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -4726,6 +4726,8 @@ out: return buf; } +#undef basename + /* No need to be reentrant or thread-safe according to SUSv3. / and \\ are treated equally. Leading drive specifiers are kept intact as far as it makes sense. Everything else is From 063e7da36fda3f42619d7df606d9f3d4920605aa Mon Sep 17 00:00:00 2001 From: Takashi Yano Date: Wed, 22 Apr 2015 13:22:59 +0200 Subject: [PATCH 082/109] Fix OPOST for non-Cygwin pty slaves * fhandler.h (class fhandler_base): Add virtual function get_io_handle_cyg() to get handle from which OPOST-processed output is read on PTY master. (class fhandler_pty_slave): Add variable output_handle_cyg to store a handle to which OPOST-processed output is written. Add two functions, i.e., set_output_handle_cyg() and get_output_handle_cyg(), regarding variable output_handle_cyg. Now, output_handle is used only by native windows program. The data before OPOST-processing is written to output_handle and OPOST-processing is applied in the master-side. For a cygwin process, OPOST-processing is applied in the slave-side, and the data after OPOST-processing is written to output_handle_cyg. (class fhandler_pty_master): Add two variables, i.e., io_handle_cyg and to_master_cyg, to store handles of a pipe through which OPOST-processed output passes. Add pty_master_fwd_thread and function pty_master_fwd_thread() for a thread which applies OPOST-processing and forwards data from io_handle to to_master_cyg. Add function get_io_handle_cyg() regarding variable io_handle_cyg. Now, the pipe between io_handle and to_master are used only by native windows program for applying OPOST-processing in the master-side. For a cygwin process, the pipe between io_handle_cyg and to_master_cyg is used for passing through the data which is applied OPOST-processing in the slave-side. * fhandler_tty.cc (struct pipe_reply): Add member to_master_cyg. (fhandler_pty_master::process_slave_output): Read slave output from io_handle_cyg rather than io_handle. (fhandler_pty_slave::fhandler_pty_salve): Initialize output_handle_cyg. (fhandler_pty_slave::open): Set output_handle_cyg by duplicating handle to_master_cyg on PTY master. (fhandler_pty_slave::close): Close handle output_handle_cyg. (fhandler_pty_slave::write): Write data to output_handle_cyg rather than output_handle. (fhandler_pty_slave::fch_close_handles): Close handle output_handle_cyg. (fhandler_pty_master::fhandler_pty_master): Initialize io_handle_cyg, to_master_cyg and master_fwd_thread. (fhandler_pty_master::cleanup): Clean up to_master_cyg as well. (fhandler_pty_master::close): Print to_master_cyg as well in debug message. Terminate master forwarding thread. Close handles to_master_cyg and io_handle_cyg. (fhandler_pty_master::ioctl): Use io_handle_cyg rather than to_master. (fhandler_pty_master::pty_master_thread): Add code for duplicating handle to_master_cyg. (fhandler_pty_master::pty_master_fwd_thread): New function for a thread to forward OPOST-processed data from io_handle to to_master_cyg. This thread applies OPOST-processing to the output of native windows program. (::pty_master_fwd_thread): Ditto. (fhandler_pty_master::setup): Create a new pipe to pass thruegh OPOST- processed output. Create new thread to forward data from io_handle to to_master_cyg. Set handle to_master_cyg to tty. Print io_handle_cyg as well in debug message. Close handles io_handle_cyg and to_master_cyg in case of error. (fhandler_pty_master::fixup_after_fork): Set handle to_master_cyg to tty. Copy handle to_master_cyg from arch->to_master_cyg. (fhandler_pty_master::fixup_after_exec): Clean up to_master_cyg. * select.cc: Check handle returned by get_io_handle_cyg() rather than get_handle(). * tty.h (class tty): Add variable _to_master_cyg to store a handle to which OPOST-processed data is written. Add two functions, to_master_cyg() and set_to_master_cyg(), regarding _to_master_cyg. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 60 +++++++++++++++++ winsup/cygwin/fhandler.h | 9 +++ winsup/cygwin/fhandler_tty.cc | 121 +++++++++++++++++++++++++++++----- winsup/cygwin/select.cc | 4 +- winsup/cygwin/tty.h | 3 + 5 files changed, 178 insertions(+), 19 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 589e0c70a..400b67e7a 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,63 @@ +2015-04-22 Takashi Yano + + * fhandler.h (class fhandler_base): Add virtual function + get_io_handle_cyg() to get handle from which OPOST-processed output is + read on PTY master. + (class fhandler_pty_slave): Add variable output_handle_cyg to store a + handle to which OPOST-processed output is written. Add two functions, + i.e., set_output_handle_cyg() and get_output_handle_cyg(), regarding + variable output_handle_cyg. Now, output_handle is used only by native + windows program. The data before OPOST-processing is written to + output_handle and OPOST-processing is applied in the master-side. For a + cygwin process, OPOST-processing is applied in the slave-side, and the + data after OPOST-processing is written to output_handle_cyg. + (class fhandler_pty_master): Add two variables, i.e., io_handle_cyg and + to_master_cyg, to store handles of a pipe through which OPOST-processed + output passes. Add pty_master_fwd_thread and function + pty_master_fwd_thread() for a thread which applies OPOST-processing + and forwards data from io_handle to to_master_cyg. Add function + get_io_handle_cyg() regarding variable io_handle_cyg. Now, the pipe + between io_handle and to_master are used only by native windows program + for applying OPOST-processing in the master-side. For a cygwin process, + the pipe between io_handle_cyg and to_master_cyg is used for passing + through the data which is applied OPOST-processing in the slave-side. + * fhandler_tty.cc (struct pipe_reply): Add member to_master_cyg. + (fhandler_pty_master::process_slave_output): Read slave output from + io_handle_cyg rather than io_handle. + (fhandler_pty_slave::fhandler_pty_salve): Initialize output_handle_cyg. + (fhandler_pty_slave::open): Set output_handle_cyg by duplicating handle + to_master_cyg on PTY master. + (fhandler_pty_slave::close): Close handle output_handle_cyg. + (fhandler_pty_slave::write): Write data to output_handle_cyg rather + than output_handle. + (fhandler_pty_slave::fch_close_handles): Close handle output_handle_cyg. + (fhandler_pty_master::fhandler_pty_master): Initialize io_handle_cyg, + to_master_cyg and master_fwd_thread. + (fhandler_pty_master::cleanup): Clean up to_master_cyg as well. + (fhandler_pty_master::close): Print to_master_cyg as well in debug + message. Terminate master forwarding thread. Close handles + to_master_cyg and io_handle_cyg. + (fhandler_pty_master::ioctl): Use io_handle_cyg rather than to_master. + (fhandler_pty_master::pty_master_thread): Add code for duplicating + handle to_master_cyg. + (fhandler_pty_master::pty_master_fwd_thread): New function for a thread + to forward OPOST-processed data from io_handle to to_master_cyg. This + thread applies OPOST-processing to the output of native windows program. + (::pty_master_fwd_thread): Ditto. + (fhandler_pty_master::setup): Create a new pipe to pass thruegh OPOST- + processed output. Create new thread to forward data from io_handle to + to_master_cyg. Set handle to_master_cyg to tty. Print io_handle_cyg as + well in debug message. Close handles io_handle_cyg and to_master_cyg in + case of error. + (fhandler_pty_master::fixup_after_fork): Set handle to_master_cyg to + tty. Copy handle to_master_cyg from arch->to_master_cyg. + (fhandler_pty_master::fixup_after_exec): Clean up to_master_cyg. + * select.cc: Check handle returned by get_io_handle_cyg() rather than + get_handle(). + * tty.h (class tty): Add variable _to_master_cyg to store a handle to + which OPOST-processed data is written. Add two functions, + to_master_cyg() and set_to_master_cyg(), regarding _to_master_cyg. + 2015-04-22 Corinna Vinschen * path.cc (basename): Undefine basename before defining function to diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 05269e59b..db3cef572 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -412,6 +412,7 @@ public: that some fd's have two handles. */ virtual HANDLE& get_handle () { return io_handle; } virtual HANDLE& get_io_handle () { return io_handle; } + virtual HANDLE& get_io_handle_cyg () { return io_handle; } virtual HANDLE& get_output_handle () { return io_handle; } virtual HANDLE get_stat_handle () { return pc.handle () ?: io_handle; } virtual HANDLE get_echo_handle () const { return NULL; } @@ -1516,6 +1517,7 @@ class fhandler_pty_common: public fhandler_termios class fhandler_pty_slave: public fhandler_pty_common { HANDLE inuse; // used to indicate that a tty is in use + HANDLE output_handle_cyg; /* Helper functions for fchmod and fchown. */ bool fch_open_handles (bool chown); @@ -1526,6 +1528,9 @@ class fhandler_pty_slave: public fhandler_pty_common /* Constructor */ fhandler_pty_slave (int); + void set_output_handle_cyg (HANDLE h) { output_handle_cyg = h; } + HANDLE& get_output_handle_cyg () { return output_handle_cyg; } + int open (int flags, mode_t mode = 0); void open_setup (int flags); ssize_t __stdcall write (const void *ptr, size_t len); @@ -1576,13 +1581,17 @@ class fhandler_pty_master: public fhandler_pty_common HANDLE from_master, to_master; HANDLE echo_r, echo_w; DWORD dwProcessId; // Owner of master handles + HANDLE io_handle_cyg, to_master_cyg; + cygthread *master_fwd_thread; // Master forwarding thread public: HANDLE get_echo_handle () const { return echo_r; } + HANDLE& get_io_handle_cyg () { return io_handle_cyg; } /* Constructor */ fhandler_pty_master (int); DWORD pty_master_thread (); + DWORD pty_master_fwd_thread (); int process_slave_output (char *buf, size_t len, int pktmode_on); void doecho (const void *str, DWORD len); int accept_input (); diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index d243d515a..d6b2e194d 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -43,6 +43,7 @@ struct pipe_request { struct pipe_reply { HANDLE from_master; HANDLE to_master; + HANDLE to_master_cyg; DWORD error; }; @@ -237,7 +238,7 @@ fhandler_pty_master::process_slave_output (char *buf, size_t len, int pktmode_on /* Check echo pipe first. */ if (::bytes_available (echo_cnt, echo_r) && echo_cnt > 0) break; - if (!bytes_available (n)) + if (!::bytes_available (n, get_io_handle_cyg ())) goto err; if (n) break; @@ -298,7 +299,7 @@ fhandler_pty_master::process_slave_output (char *buf, size_t len, int pktmode_on goto err; } } - else if (!ReadFile (get_handle (), outbuf, rlen, &n, NULL)) + else if (!ReadFile (get_io_handle_cyg (), outbuf, rlen, &n, NULL)) { termios_printf ("ReadFile failed, %E"); goto err; @@ -333,7 +334,7 @@ out: /* pty slave stuff */ fhandler_pty_slave::fhandler_pty_slave (int unit) - : fhandler_pty_common (), inuse (NULL) + : fhandler_pty_common (), inuse (NULL), output_handle_cyg (NULL) { if (unit >= 0) dev ().parse (DEV_PTYS_MAJOR, unit); @@ -342,11 +343,11 @@ fhandler_pty_slave::fhandler_pty_slave (int unit) int fhandler_pty_slave::open (int flags, mode_t) { - HANDLE pty_owner, from_master_local, to_master_local; + HANDLE pty_owner, from_master_local, to_master_local, to_master_cyg_local; HANDLE *handles[] = { &from_master_local, &input_available_event, &input_mutex, &inuse, - &output_mutex, &to_master_local, &pty_owner, + &output_mutex, &to_master_local, &pty_owner, &to_master_cyg_local, NULL }; @@ -397,7 +398,8 @@ fhandler_pty_slave::open (int flags, mode_t) release_output_mutex (); } - if (!get_ttyp ()->from_master () || !get_ttyp ()->to_master ()) + if (!get_ttyp ()->from_master () || + !get_ttyp ()->to_master () || !get_ttyp ()->to_master_cyg ()) { errmsg = "pty handles have been closed"; set_errno (EACCES); @@ -448,6 +450,13 @@ fhandler_pty_slave::open (int flags, mode_t) errmsg = "can't duplicate output, %E"; goto err; } + if (!DuplicateHandle (pty_owner, get_ttyp ()->to_master_cyg (), + GetCurrentProcess (), &to_master_cyg_local, 0, TRUE, + DUPLICATE_SAME_ACCESS)) + { + errmsg = "can't duplicate output for cygwin, %E"; + goto err; + } if (pty_owner != GetCurrentProcess ()) CloseHandle (pty_owner); } @@ -468,7 +477,8 @@ fhandler_pty_slave::open (int flags, mode_t) } from_master_local = repl.from_master; to_master_local = repl.to_master; - if (!from_master_local || !to_master_local) + to_master_cyg_local = repl.to_master_cyg; + if (!from_master_local || !to_master_local || !to_master_cyg_local) { SetLastError (repl.error); errmsg = "error duplicating pipes, %E"; @@ -477,14 +487,18 @@ fhandler_pty_slave::open (int flags, mode_t) } VerifyHandle (from_master_local); VerifyHandle (to_master_local); + VerifyHandle (to_master_cyg_local); termios_printf ("duplicated from_master %p->%p from pty_owner", get_ttyp ()->from_master (), from_master_local); termios_printf ("duplicated to_master %p->%p from pty_owner", get_ttyp ()->to_master (), to_master_local); + termios_printf ("duplicated to_master_cyg %p->%p from pty_owner", + get_ttyp ()->to_master_cyg (), to_master_cyg_local); set_io_handle (from_master_local); set_output_handle (to_master_local); + set_output_handle_cyg (to_master_cyg_local); fhandler_console::need_invisible (); set_open_status (); @@ -533,6 +547,9 @@ fhandler_pty_slave::close () termios_printf ("CloseHandle (inuse), %E"); if (!ForceCloseHandle (input_available_event)) termios_printf ("CloseHandle (input_available_event<%p>), %E", input_available_event); + if (!ForceCloseHandle (get_output_handle_cyg ())) + termios_printf ("CloseHandle (get_output_handle_cyg ()<%p>), %E", + get_output_handle_cyg ()); if ((unsigned) myself->ctty == FHDEV (DEV_PTYS_MAJOR, get_minor ())) fhandler_console::free_console (); /* assumes that we are the last pty closer */ return fhandler_pty_common::close (); @@ -591,7 +608,7 @@ fhandler_pty_slave::write (const void *ptr, size_t len) push_process_state process_state (PID_TTYOU); - if (!process_opost_output (get_output_handle (), ptr, towrite, false)) + if (!process_opost_output (get_output_handle_cyg (), ptr, towrite, false)) { DWORD err = GetLastError (); termios_printf ("WriteFile failed, %E"); @@ -1125,6 +1142,7 @@ fhandler_pty_slave::fch_close_handles () { close_maybe (get_io_handle ()); close_maybe (get_output_handle ()); + close_maybe (get_output_handle_cyg ()); close_maybe (input_available_event); close_maybe (output_mutex); close_maybe (input_mutex); @@ -1200,7 +1218,8 @@ errout: fhandler_pty_master::fhandler_pty_master (int unit) : fhandler_pty_common (), pktmode (0), master_ctl (NULL), master_thread (NULL), from_master (NULL), to_master (NULL), - echo_r (NULL), echo_w (NULL), dwProcessId (0) + echo_r (NULL), echo_w (NULL), dwProcessId (0), + io_handle_cyg (NULL), to_master_cyg (NULL), master_fwd_thread (NULL) { if (unit >= 0) dev ().parse (DEV_PTYM_MAJOR, unit); @@ -1258,15 +1277,15 @@ fhandler_pty_master::cleanup () { report_tty_counts (this, "closing master", ""); if (archetype) - from_master = to_master = NULL; + from_master = to_master = to_master_cyg = NULL; fhandler_base::cleanup (); } int fhandler_pty_master::close () { - termios_printf ("closing from_master(%p)/to_master(%p) since we own them(%u)", - from_master, to_master, dwProcessId); + termios_printf ("closing from_master(%p)/to_master(%p)/to_master_cyg(%p) since we own them(%u)", + from_master, to_master, to_master_cyg, dwProcessId); if (cygwin_finished_initializing) { if (master_ctl && get_ttyp ()->master_pid == myself->pid) @@ -1289,6 +1308,7 @@ fhandler_pty_master::close () master_ctl = NULL; } release_output_mutex (); + master_fwd_thread->terminate_thread (); } } @@ -1305,6 +1325,11 @@ fhandler_pty_master::close () if (!ForceCloseHandle (to_master)) termios_printf ("error closing to_master %p, %E", to_master); from_master = to_master = NULL; + if (!ForceCloseHandle (get_io_handle_cyg ())) + termios_printf ("error closing io_handle_cyg %p, %E", get_io_handle_cyg ()); + if (!ForceCloseHandle (to_master_cyg)) + termios_printf ("error closing to_master_cyg %p, %E", to_master_cyg); + get_io_handle_cyg () = to_master_cyg = NULL; ForceCloseHandle (echo_r); ForceCloseHandle (echo_w); echo_r = echo_w = NULL; @@ -1411,7 +1436,7 @@ fhandler_pty_master::ioctl (unsigned int cmd, void *arg) case FIONREAD: { DWORD n; - if (!::bytes_available (n, to_master)) + if (!::bytes_available (n, get_io_handle_cyg ())) { set_errno (EINVAL); return -1; @@ -1581,6 +1606,13 @@ fhandler_pty_master::pty_master_thread () termios_printf ("DuplicateHandle (to_master), %E"); goto reply; } + if (!DuplicateHandle (GetCurrentProcess (), to_master_cyg, + client, &repl.to_master_cyg, + 0, TRUE, DUPLICATE_SAME_ACCESS)) + { + termios_printf ("DuplicateHandle (to_master_cyg), %E"); + goto reply; + } } reply: repl.error = GetLastError (); @@ -1606,6 +1638,40 @@ pty_master_thread (VOID *arg) return ((fhandler_pty_master *) arg)->pty_master_thread (); } +DWORD +fhandler_pty_master::pty_master_fwd_thread () +{ + DWORD rlen; + char outbuf[OUT_BUFFER_SIZE]; + + termios_printf("Started."); + for (;;) + { + if (!ReadFile (get_io_handle (), outbuf, sizeof outbuf, &rlen, NULL)) + { + termios_printf ("ReadFile for forwarding failed, %E"); + break; + } + ssize_t wlen = rlen; + while (rlen>0) + { + if (!process_opost_output (to_master_cyg, outbuf, wlen, false)) + { + termios_printf ("WriteFile for forwarding failed, %E"); + break; + } + rlen -= wlen; + } + } + return 0; +} + +static DWORD WINAPI +pty_master_fwd_thread (VOID *arg) +{ + return ((fhandler_pty_master *) arg)->pty_master_fwd_thread (); +} + bool fhandler_pty_master::setup () { @@ -1632,7 +1698,7 @@ fhandler_pty_master::setup () termios_printf ("can't set output_handle(%p) to non-blocking mode", get_output_handle ()); - char pipename[sizeof("ptyNNNN-from-master")]; + char pipename[sizeof("ptyNNNN-to-master-cyg")]; __small_sprintf (pipename, "pty%d-to-master", unit); res = fhandler_pipe::create (&sec_none, &get_io_handle (), &to_master, fhandler_pty_common::pipesize, pipename, 0); @@ -1642,6 +1708,15 @@ fhandler_pty_master::setup () goto err; } + __small_sprintf (pipename, "pty%d-to-master-cyg", unit); + res = fhandler_pipe::create (&sec_none, &get_io_handle_cyg (), &to_master_cyg, + fhandler_pty_common::pipesize, pipename, 0); + if (res) + { + errstr = "output pipe for cygwin"; + goto err; + } + ProtectHandle1 (get_io_handle (), from_pty); __small_sprintf (pipename, "pty%d-echoloop", unit); @@ -1700,28 +1775,38 @@ fhandler_pty_master::setup () errstr = "pty master control thread"; goto err; } + master_fwd_thread = new cygthread (::pty_master_fwd_thread, this, "ptymf"); + if (!master_fwd_thread) + { + errstr = "pty master forwarding thread"; + goto err; + } t.set_from_master (from_master); t.set_to_master (to_master); + t.set_to_master_cyg (to_master_cyg); t.winsize.ws_col = 80; t.winsize.ws_row = 25; t.master_pid = myself->pid; dev ().parse (DEV_PTYM_MAJOR, unit); - termios_printf ("this %p, pty%d opened - from_pty %p, to_pty %p", this, unit, - get_io_handle (), get_output_handle ()); + termios_printf ("this %p, pty%d opened - from_pty <%p,%p>, to_pty %p", + this, unit, get_io_handle (), get_io_handle_cyg (), + get_output_handle ()); return true; err: __seterrno (); close_maybe (get_io_handle ()); + close_maybe (get_io_handle_cyg ()); close_maybe (get_output_handle ()); close_maybe (input_available_event); close_maybe (output_mutex); close_maybe (input_mutex); close_maybe (from_master); close_maybe (to_master); + close_maybe (to_master_cyg); close_maybe (echo_r); close_maybe (echo_w); close_maybe (master_ctl); @@ -1741,11 +1826,13 @@ fhandler_pty_master::fixup_after_fork (HANDLE parent) { t.set_from_master (arch->from_master); t.set_to_master (arch->to_master); + t.set_to_master_cyg (arch->to_master_cyg); } arch->dwProcessId = wpid; } from_master = arch->from_master; to_master = arch->to_master; + to_master_cyg = arch->to_master_cyg; report_tty_counts (this, "inherited master", ""); } @@ -1755,7 +1842,7 @@ fhandler_pty_master::fixup_after_exec () if (!close_on_exec ()) fixup_after_fork (spawn_info->parent); else - from_master = to_master = NULL; + from_master = to_master = to_master_cyg = NULL; } BOOL diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 1706c87c8..803e5d5f5 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -80,7 +80,7 @@ details. */ #define copyfd_set(to, from, n) memcpy (to, from, sizeof_fd_set (n)); #define set_handle_or_return_if_not_open(h, s) \ - h = (s)->fh->get_handle (); \ + h = (s)->fh->get_io_handle_cyg (); \ if (cygheap->fdtab.not_open ((s)->fd)) \ { \ (s)->thread_errno = EBADF; \ @@ -1264,7 +1264,7 @@ fhandler_base::select_read (select_stuff *ss) s->startup = no_startup; s->verify = verify_ok; } - s->h = get_handle (); + s->h = get_io_handle_cyg (); s->read_selected = true; s->read_ready = true; return s; diff --git a/winsup/cygwin/tty.h b/winsup/cygwin/tty.h index 27d43f731..522cf9e36 100644 --- a/winsup/cygwin/tty.h +++ b/winsup/cygwin/tty.h @@ -92,12 +92,15 @@ public: private: HANDLE _from_master; HANDLE _to_master; + HANDLE _to_master_cyg; public: HANDLE from_master() const { return _from_master; } HANDLE to_master() const { return _to_master; } + HANDLE to_master_cyg() const { return _to_master_cyg; } void set_from_master (HANDLE h) { _from_master = h; } void set_to_master (HANDLE h) { _to_master = h; } + void set_to_master_cyg (HANDLE h) { _to_master_cyg = h; } int read_retval; bool was_opened; /* True if opened at least once. */ From 46077e809d15ea008576b305799e476ee80d5474 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 22 Apr 2015 13:26:37 +0200 Subject: [PATCH 083/109] Fix closing too many handles in pty fchown/fchmod * fhandler_tty.cc (fhandler_pty_slave::fch_close_handles): Don't close handles not opened via fhandler_pty_slave::fch_open_handles. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/fhandler_tty.cc | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 400b67e7a..ee7b7a459 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-22 Corinna Vinschen + + * fhandler_tty.cc (fhandler_pty_slave::fch_close_handles): Don't close + handles not opened via fhandler_pty_slave::fch_open_handles. + 2015-04-22 Takashi Yano * fhandler.h (class fhandler_base): Add virtual function diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index d6b2e194d..e91b3e398 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -1140,9 +1140,6 @@ fhandler_pty_slave::fch_set_sd (security_descriptor &sd, bool chown) void fhandler_pty_slave::fch_close_handles () { - close_maybe (get_io_handle ()); - close_maybe (get_output_handle ()); - close_maybe (get_output_handle_cyg ()); close_maybe (input_available_event); close_maybe (output_mutex); close_maybe (input_mutex); From 5de9c2745c5539909973771844bcbef3e94c2070 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 23 Apr 2015 15:02:32 +0200 Subject: [PATCH 084/109] Handle unlinking in-use files on virtual drives * path.cc (path_conv::set_nt_native_path): New function. * path.h (path_conv::set_nt_native_path): Add prototype. * syscall.cc (try_to_bin): Handle moving files to the recycler accessed via a local virtual drive (subst). Fix a problem renaming the file to the unique replacement name on Samba. Align comment. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/path.cc | 12 ++++++++++++ winsup/cygwin/path.h | 1 + winsup/cygwin/syscalls.cc | 28 +++++++++++++++++++++++++--- 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ee7b7a459..7b61fb2aa 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2015-04-23 Corinna Vinschen + + * path.cc (path_conv::set_nt_native_path): New function. + * path.h (path_conv::set_nt_native_path): Add prototype. + * syscall.cc (try_to_bin): Handle moving files to the recycler + accessed via a local virtual drive (subst). Fix a problem renaming + the file to the unique replacement name on Samba. Align comment. + 2015-04-22 Corinna Vinschen * fhandler_tty.cc (fhandler_pty_slave::fch_close_handles): Don't close diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index ea5595698..b1a02e133 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -486,6 +486,18 @@ get_nt_native_path (const char *path, UNICODE_STRING& upath, bool dos) return &upath; } +/* Handle with extrem care! Only used in a certain instance in try_to_bin. + Every other usage needs a careful check. */ +void +path_conv::set_nt_native_path (PUNICODE_STRING new_path) +{ + wide_path = (PWCHAR) crealloc_abort (wide_path, new_path->MaximumLength); + memcpy (wide_path, new_path->Buffer, new_path->Length); + uni_path.Length = new_path->Length; + uni_path.MaximumLength = new_path->MaximumLength; + uni_path.Buffer = wide_path; +} + PUNICODE_STRING path_conv::get_nt_native_path () { diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index a668eae6e..5c464dc9a 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -270,6 +270,7 @@ class path_conv ~path_conv (); inline const char *get_win32 () const { return path; } + void set_nt_native_path (PUNICODE_STRING); PUNICODE_STRING get_nt_native_path (); inline POBJECT_ATTRIBUTES get_object_attr (OBJECT_ATTRIBUTES &attr, SECURITY_ATTRIBUTES &sa) diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 5dc2a452c..86faa31e4 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -314,15 +314,35 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access, ULONG flags) RtlAppendUnicodeToString (&recycler, L"\\Recycled\\"); else goto out; - /* Is the file a subdir of the recycler? */ RtlInitCountedUnicodeString(&fname, pfni->FileName, pfni->FileNameLength); + /* Is the file a subdir of the recycler? */ if (RtlEqualUnicodePathPrefix (&fname, &recycler, TRUE)) goto out; /* Is fname the recycler? Temporarily hide trailing backslash. */ recycler.Length -= sizeof (WCHAR); if (RtlEqualUnicodeString (&fname, &recycler, TRUE)) goto out; + /* Is fname really a subcomponent of the full path? If not, there's + a high probability we're acessing the file via a virtual drive + created with "subst". Check and accommodate it. Note that we + ony get here if the virtual drive is really pointing to a local + drive. Otherwise pc.isremote () returns "true". */ + if (!RtlEqualUnicodePathSuffix (pc.get_nt_native_path (), &fname, TRUE)) + { + WCHAR drive[3] = { pc.get_nt_native_path ()->Buffer[4], ':', '\0' }; + PWCHAR tgt = tp.w_get (); + if (QueryDosDeviceW (drive, tgt, NT_MAX_PATH) + && !wcsncmp (tgt, L"\\??\\", 4)) + { + UNICODE_STRING new_path; + + wcsncpy (tgt + 6, fname.Buffer, fname.Length / sizeof (WCHAR)); + RtlInitCountedUnicodeString(&new_path, tgt, + 6 * sizeof (WCHAR) + fname.Length); + pc.set_nt_native_path (&new_path); + } + } /* Create root dir path from file name information. */ RtlSplitUnicodePath (&fname, &fname, NULL); RtlSplitUnicodePath (pc.get_nt_native_path (), &root, NULL); @@ -367,9 +387,11 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access, ULONG flags) starting at U+dc00. Use plain ASCII chars on filesystems not supporting Unicode. The rest of the filename is the inode number in hex encoding and a hash of the full NT path in hex. The combination allows to remove - multiple hardlinks to the same file. */ + multiple hardlinks to the same file. Samba doesn't like the transposed + names. */ RtlAppendUnicodeToString (&recycler, - pc.fs_flags () & FILE_UNICODE_ON_DISK + (pc.fs_flags () & FILE_UNICODE_ON_DISK + && !pc.fs_is_samba ()) ? L".\xdc63\xdc79\xdc67" : L".cyg"); pfii = (PFILE_INTERNAL_INFORMATION) infobuf; /* Note: Modern Samba versions apparently don't like buffer sizes of more From ad8b1e3185d0f885694bfa3015d8a29441e7f251 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 23 Apr 2015 15:22:37 +0200 Subject: [PATCH 085/109] Document previous unlink patch Signed-off-by: Corinna Vinschen --- winsup/cygwin/release/2.0.0 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/winsup/cygwin/release/2.0.0 b/winsup/cygwin/release/2.0.0 index d35b7232e..6a9628b64 100644 --- a/winsup/cygwin/release/2.0.0 +++ b/winsup/cygwin/release/2.0.0 @@ -61,3 +61,9 @@ Bug Fixes - Fix shmget usage of size parameter for already existing segments. Addresses: https://cygwin.com/ml/cygwin/2015-04/msg00105.html + +- Fix how in-use files on virtual drives created via subst are moved to + the recycler in unlink(2). + Addresses: https://cygwin.com/ml/cygwin/2015-04/msg00527.html + +- Fix how in-use files on Samba drives are renamed in unlink(2). From 88771d303f9b1a030f13e0ce6eaf10a4f01a4090 Mon Sep 17 00:00:00 2001 From: Mike DePaulo Date: Mon, 27 Apr 2015 04:46:18 -0400 Subject: [PATCH 086/109] cygserver.xml: Add new section. How to install Cygserver. * cygserver.xml (install-cygserver): Add new section. How to install Cygserver. Signed-off-by: Corinna Vinschen --- winsup/doc/ChangeLog | 5 +++++ winsup/doc/cygserver.xml | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index fdf3708ec..aaecb69e7 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-04-27 Mike DePaulo + + * cygserver.xml (install-cygserver): Add new section. How to install + Cygserver. + 2015-04-16 Corinna Vinschen * utils.xml (setfacl): Show new option output. diff --git a/winsup/doc/cygserver.xml b/winsup/doc/cygserver.xml index 6a4ec4ec5..2367a60ef 100644 --- a/winsup/doc/cygserver.xml +++ b/winsup/doc/cygserver.xml @@ -179,6 +179,19 @@ +How to install Cygserver + + + Cygserver is part of the base cygwin package. + Therefore, whenever Cygwin is installed, so is Cygserver. + + + You may want to install Cygserver as a service. See + . + + + + How to start Cygserver From 9d2727e9a3355f1d48ff3ccc28c453d0bc3ca435 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 27 Apr 2015 14:39:57 +0200 Subject: [PATCH 087/109] Define __s64 and __u64 * include/asm/types.h: Add __s64 and __u64 types. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/include/asm/types.h | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7b61fb2aa..07ec831de 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2015-04-27 Corinna Vinschen + + * include/asm/types.h: Add __s64 and __u64 types. + 2015-04-23 Corinna Vinschen * path.cc (path_conv::set_nt_native_path): New function. diff --git a/winsup/cygwin/include/asm/types.h b/winsup/cygwin/include/asm/types.h index 19cc2ca60..dc51af63a 100644 --- a/winsup/cygwin/include/asm/types.h +++ b/winsup/cygwin/include/asm/types.h @@ -1,6 +1,6 @@ /* asm/types.h - Copyright 1998, 2000, 2001 Red Hat, Inc. + Copyright 1998, 2000, 2001, 2015 Red Hat, Inc. This file is part of Cygwin. @@ -20,4 +20,8 @@ typedef unsigned short __u16; typedef __signed__ int __s32; typedef unsigned int __u32; +/* As on Linux. Works for both platforms, i686 and x86_64. */ +typedef __signed__ long long __s64; +typedef unsigned long long __u64; + #endif /* _ASM_TYPES_H */ From 496380c166667907202c7793436187940d39df14 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 29 Apr 2015 13:06:45 +0200 Subject: [PATCH 088/109] Improve check for int32_t being long or int * libc/include/sys/config.h: Move evaluation of _UINTPTR_EQ_ULONG and _UINTPTR_EQ_ULONGLONG from here... * libc/include/sys/_intsup.h: ...to here. Rename to _INTPTR_EQ_LONG and _INTPTR_EQ_LONGLONG to refer to signed base type. Add test for base type of int32_t and set _INT32_EQ_LONG accordingly. * libc/include/stdint.h: Change checks for __have_long32 to checks for _INT32_EQ_LONG. * libc/include/inttypes.h: Ditto. Accommodate aforementioned name change. Signed-off-by: Corinna Vinschen --- newlib/ChangeLog | 12 +++++++++++ newlib/libc/include/inttypes.h | 6 +++--- newlib/libc/include/stdint.h | 6 +++--- newlib/libc/include/sys/_intsup.h | 35 +++++++++++++++++++++++++++++++ newlib/libc/include/sys/config.h | 26 ----------------------- 5 files changed, 53 insertions(+), 32 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index edf4a7fce..2e8706367 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,15 @@ +2015-04-29 Corinna Vinschen + + * libc/include/sys/config.h: Move evaluation of _UINTPTR_EQ_ULONG and + _UINTPTR_EQ_ULONGLONG from here... + * libc/include/sys/_intsup.h: ...to here. Rename to _INTPTR_EQ_LONG + and _INTPTR_EQ_LONGLONG to refer to signed base type. Add test for + base type of int32_t and set _INT32_EQ_LONG accordingly. + * libc/include/stdint.h: Change checks for __have_long32 to checks + for _INT32_EQ_LONG. + * libc/include/inttypes.h: Ditto. Accommodate aforementioned name + change. + 2015-04-22 Corinna Vinschen * libc/include/libgen.h (basename): Drop defining _BASENAME_DEFINED. diff --git a/newlib/libc/include/inttypes.h b/newlib/libc/include/inttypes.h index 52b2d845c..7158cc667 100644 --- a/newlib/libc/include/inttypes.h +++ b/newlib/libc/include/inttypes.h @@ -142,7 +142,7 @@ #define SCNxFAST16 __SCN16(x) /* 32-bit types */ -#if __have_long32 +#if defined (_INT32_EQ_LONG) #define __PRI32(x) __STRINGIFY(l##x) #define __SCN32(x) __STRINGIFY(l##x) #else @@ -272,10 +272,10 @@ #define SCNxMAX __SCNMAX(x) /* ptr types */ -#if defined(_UINTPTR_EQ_ULONGLONG) +#if defined (_INTPTR_EQ_LONGLONG) # define __PRIPTR(x) __STRINGIFY(ll##x) # define __SCNPTR(x) __STRINGIFY(ll##x) -#elif defined(_UINTPTR_EQ_ULONG) +#elif defined (_INTPTR_EQ_LONG) # define __PRIPTR(x) __STRINGIFY(l##x) # define __SCNPTR(x) __STRINGIFY(l##x) #else diff --git a/newlib/libc/include/stdint.h b/newlib/libc/include/stdint.h index aa9d68e9e..bd65cd0e0 100644 --- a/newlib/libc/include/stdint.h +++ b/newlib/libc/include/stdint.h @@ -216,7 +216,7 @@ typedef __uint_least64_t uint_least64_t; #define INT32_MAX (__INT32_MAX__) #define UINT32_MAX (__UINT32_MAX__) #elif defined(__int32_t_defined) -#if __have_long32 +#if defined (_INT32_EQ_LONG) #define INT32_MIN (-2147483647L-1) #define INT32_MAX (2147483647L) #define UINT32_MAX (4294967295UL) @@ -232,7 +232,7 @@ typedef __uint_least64_t uint_least64_t; #define INT_LEAST32_MAX (__INT_LEAST32_MAX__) #define UINT_LEAST32_MAX (__UINT_LEAST32_MAX__) #elif defined(__int_least32_t_defined) -#if __have_long32 +#if defined (_INT32_EQ_LONG) #define INT_LEAST32_MIN (-2147483647L-1) #define INT_LEAST32_MAX (2147483647L) #define UINT_LEAST32_MAX (4294967295UL) @@ -439,7 +439,7 @@ typedef __uint_least64_t uint_least64_t; #define INT32_C(x) __INT32_C(x) #define UINT32_C(x) __UINT32_C(x) #else -#if __have_long32 +#if defined (_INT32_EQ_LONG) #define INT32_C(x) x##L #define UINT32_C(x) x##UL #else diff --git a/newlib/libc/include/sys/_intsup.h b/newlib/libc/include/sys/_intsup.h index 7c3bc01cb..6c53641a5 100644 --- a/newlib/libc/include/sys/_intsup.h +++ b/newlib/libc/include/sys/_intsup.h @@ -33,4 +33,39 @@ #define __have_long32 1 #endif +/* Determine how intptr_t and int32_t are defined by gcc for this target. This + is used to determine the correct printf() constant in inttypes.h and other + constants in stdint.h. */ +#pragma push_macro("signed") +#pragma push_macro("int") +#pragma push_macro("long") +#undef signed +#undef int +#undef long +#define signed +0 +#define int +0 +#define long +1 +#if __INTPTR_TYPE__ == 2 +#define _INTPTR_EQ_LONGLONG +#elif __INTPTR_TYPE__ == 1 +#define _INTPTR_EQ_LONG +#elif __INTPTR_TYPE__ == 0 +/* Nothing to define because intptr_t is safe to print as an int. */ +#else +#error "Unable to determine type definition of intptr_t" +#endif +#if __INT32_TYPE__ == 1 +#define _INT32_EQ_LONG +#elif __INT32_TYPE__ == 0 +/* Nothing to define because int32_t is safe to print as an int. */ +#else +#error "Unable to determine type definition of int32_t" +#endif +#undef long +#undef int +#undef signed +#pragma pop_macro("signed") +#pragma pop_macro("int") +#pragma pop_macro("long") + #endif /* _SYS__INTSUP_H */ diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h index 04f1e3abf..5297befe5 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -287,30 +287,4 @@ #define _MB_EXTENDED_CHARSETS_WINDOWS 1 #endif -/* Determine how uintptr_t is defined by gcc for this target. This - is used to determine the correct printf() constant in inttypes.h */ -#pragma push_macro("signed") -#pragma push_macro("int") -#pragma push_macro("long") -#undef signed -#undef int -#undef long -#define signed +0 -#define int +0 -#define long +1 -#if __INTPTR_TYPE__ == 2 -#define _UINTPTR_EQ_ULONGLONG -#elif __INTPTR_TYPE__ == 1 -#define _UINTPTR_EQ_ULONG -#elif __INTPTR_TYPE__ == 0 -/* Nothing to define because intptr_t is safe to print as an int. */ -#else -#error "Unable to determine type definition of uintptr_t" -#endif -#undef long -#undef int -#undef signed -#pragma pop_macro("signed") -#pragma pop_macro("int") -#pragma pop_macro("long") #endif /* __SYS_CONFIG_H__ */ From f737914dd6b26612b1db26950e267f5589cb21bb Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 29 Apr 2015 11:20:21 -0500 Subject: [PATCH 089/109] Fix more typos in ntsec.xml Signed-off-by: Yaakov Selkowitz --- winsup/doc/ntsec.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/winsup/doc/ntsec.xml b/winsup/doc/ntsec.xml index b731cd0e1..d98286715 100644 --- a/winsup/doc/ntsec.xml +++ b/winsup/doc/ntsec.xml @@ -863,7 +863,7 @@ the old information. So, what settings can we perform with /etc/nsswitch.conf? Let's start with an example /etc/nsswitch.conf file -file set up to all default values: +set up to all default values: @@ -1749,7 +1749,7 @@ The unix schema utilizes the posixAccount attribute extension. This is one of two schema extensions which are connected to AD accounts, available by default starting with Windows Server 2003 R2. They are usually -not set, unless used by the Active Directory +not set, unless used by the Active Directory Server for NIS feature (deprecated since Server 2012 R2). Two schemata are interesting for Cygwin, posixAccount, @@ -2031,7 +2031,7 @@ by child processes. A fully set up Samba file server with domain integration is running winbindd to -map Window SIDs to artificially created UNIX uids and gids, and this mapping is +map Windows SIDs to artificially created UNIX uids and gids, and this mapping is transparent within the domain, so Cygwin doesn't have to do anything special. @@ -2134,7 +2134,7 @@ met. Later ACEs are not taken into account. All access denied ACEs should precede any access allowed ACE. ACLs -following this rule are called "canonical" +following this rule are called "canonical". Note that the last rule is a preference or a definition of From 17a6effb5fd60ec23f156bbed9d841e1fd94e9b3 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 30 Apr 2015 12:08:20 +0200 Subject: [PATCH 090/109] Use all ACEs from original ACL on Samba share * security.cc (convert_samba_sd): Fix accidental dropping of all non-Unix User, non-Unix Group accounts. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/security.cc | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 07ec831de..b67e33f1c 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-30 Corinna Vinschen + + * security.cc (convert_samba_sd): Fix accidental dropping of all + non-Unix User, non-Unix Group accounts. + 2015-04-27 Corinna Vinschen * include/asm/types.h: Add __s64 and __u64 types. diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 5fca6746e..bee9b06ae 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -677,10 +677,10 @@ convert_samba_sd (security_descriptor &sd_ret) if (gid < UNIX_POSIX_OFFSET && (grp = internal_getgrgid (gid))) ace_sid.getfromgr (grp); } - if (!add_access_allowed_ace (acl, ace->Mask, ace_sid, acl_len, - ace->Header.AceFlags)) - return; } + if (!add_access_allowed_ace (acl, ace->Mask, ace_sid, acl_len, + ace->Header.AceFlags)) + return; } acl->AclSize = acl_len; From d7641067d4056b6b9ece8e44029d618c24cebe30 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 30 Apr 2015 17:53:15 +0200 Subject: [PATCH 091/109] Bump minor DLL version to 1 Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/include/cygwin/version.h | 2 +- winsup/cygwin/release/2.0.1 | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 winsup/cygwin/release/2.0.1 diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b67e33f1c..7505bf963 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2015-04-30 Corinna Vinschen + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 1. + 2015-04-30 Corinna Vinschen * security.cc (convert_samba_sd): Fix accidental dropping of all diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 7734b120b..1ac9e6ecd 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -43,7 +43,7 @@ details. */ changes to the DLL and is mainly informative in nature. */ #define CYGWIN_VERSION_DLL_MAJOR 2000 -#define CYGWIN_VERSION_DLL_MINOR 0 +#define CYGWIN_VERSION_DLL_MINOR 1 /* Major numbers before CYGWIN_VERSION_DLL_EPOCH are incompatible. */ diff --git a/winsup/cygwin/release/2.0.1 b/winsup/cygwin/release/2.0.1 new file mode 100644 index 000000000..3d10d8d9a --- /dev/null +++ b/winsup/cygwin/release/2.0.1 @@ -0,0 +1,8 @@ +Bug Fixes +--------- + +- Fix type check for base type of int32_t/uint32_t. + Addresses: https://cygwin.com/ml/cygwin/2015-04/msg00602.html + +- Fix a bug in SID conversion per RFC2307 on Samba shares. + Addresses: https://cygwin.com/ml/cygwin/2015-04/msg00636.html From e738fc4f99d824d0ae36fa988086a241dfe68460 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 2 May 2015 15:07:44 +0200 Subject: [PATCH 092/109] Revert to exposing sys/select.h from sys/time.h on Cygwin * libc/include/sys/time.h: Include sys/select.h on Cygwin. Explain why. Signed-off-by: Corinna Vinschen --- newlib/ChangeLog | 4 ++++ newlib/libc/include/sys/time.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 2e8706367..e40d26bdf 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2015-05-02 Corinna Vinschen + + * libc/include/sys/time.h: Include sys/select.h on Cygwin. Explain why. + 2015-04-29 Corinna Vinschen * libc/include/sys/config.h: Move evaluation of _UINTPTR_EQ_ULONG and diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h index ce8cad662..e95240e60 100644 --- a/newlib/libc/include/sys/time.h +++ b/newlib/libc/include/sys/time.h @@ -42,6 +42,12 @@ #include #include +/* Cygwin exposes sys/select.h to users of sys/time.h for a couple of years + so we have to maintain that. Note that this is in accordance with POSIX. */ +#ifdef __CYGWIN__ +#include +#endif /* __CYGWIN__ */ + struct timezone { int tz_minuteswest; /* minutes west of Greenwich */ int tz_dsttime; /* type of dst correction */ From e0ddd3b833004e2253213705cc0da0acae649536 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sun, 3 May 2015 12:28:39 +0200 Subject: [PATCH 093/109] Bump minor DLL version to 2 Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/include/cygwin/version.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7505bf963..3ecbc6b30 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2015-05-03 Corinna Vinschen + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 2. + 2015-04-30 Corinna Vinschen * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 1. diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 1ac9e6ecd..b9a09f5ef 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -43,7 +43,7 @@ details. */ changes to the DLL and is mainly informative in nature. */ #define CYGWIN_VERSION_DLL_MAJOR 2000 -#define CYGWIN_VERSION_DLL_MINOR 1 +#define CYGWIN_VERSION_DLL_MINOR 2 /* Major numbers before CYGWIN_VERSION_DLL_EPOCH are incompatible. */ From 474fb80297c858d649f0cfeb5c60125153e97ae5 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 5 May 2015 12:45:38 +0100 Subject: [PATCH 094/109] Adds support for placing MSP430 code and data into either low memory or high memory. * msp430/msp430.ld: Delete. * msp430/msp430F5438A-l.ld: Delete. * msp430/msp430F5438A-s.ld: Delete. * msp430/crt_movedata.S: Delete. * msp430/Makefile.in (SCRIPTS): Remove msp430.ld. (CRT_OBJS): Add crt_move_highdata.o. * msp430/memmodel.h (START_CRT_FUNC): New macro. (END_CRT_FUNC): New macro. (WEAK_DEF): New macro. * msp430/crt0.S: Use new macros. (move_highdata): New code to initialise the .data section if it is held in high memory. * msp430/msp430-sim.ld (.data): Add .either.data. (.rodata2): Move some read-only data sections here. (.text): Add .either.text. (.rodata): Add .either.rodata. (.bss): Add .either.bss. * msp430/msp430xl-sim.ld (MEMORY): Add HIROM. (.rodata2): Move some read-only data sections here. (.upper.data): New section. Include notes about how to initialise it. --- libgloss/ChangeLog | 26 +++ libgloss/msp430/Makefile.in | 4 +- libgloss/msp430/crt0.S | 196 +++++++++++++++----- libgloss/msp430/crt_movedata.S | 50 ----- libgloss/msp430/memmodel.h | 29 ++- libgloss/msp430/msp430-sim.ld | 33 +++- libgloss/msp430/msp430.ld | 200 -------------------- libgloss/msp430/msp430F5438A-l.ld | 220 ---------------------- libgloss/msp430/msp430F5438A-s.ld | 206 --------------------- libgloss/msp430/msp430xl-sim.ld | 291 ++++++++++++++++++++++++------ 10 files changed, 462 insertions(+), 793 deletions(-) delete mode 100644 libgloss/msp430/crt_movedata.S delete mode 100644 libgloss/msp430/msp430.ld delete mode 100644 libgloss/msp430/msp430F5438A-l.ld delete mode 100644 libgloss/msp430/msp430F5438A-s.ld diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index a47d78dbd..5c96c23e8 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,29 @@ +2015-05-05 Nick Clifton + + * msp430/msp430.ld: Delete. + * msp430/msp430F5438A-l.ld: Delete. + * msp430/msp430F5438A-s.ld: Delete. + * msp430/crt_movedata.S: Delete. + + * msp430/Makefile.in (SCRIPTS): Remove msp430.ld. + (CRT_OBJS): Add crt_move_highdata.o. + * msp430/memmodel.h (START_CRT_FUNC): New macro. + (END_CRT_FUNC): New macro. + (WEAK_DEF): New macro. + * msp430/crt0.S: Use new macros. + (move_highdata): New code to initialise the .data section if it is + held in high memory. + + * msp430/msp430-sim.ld (.data): Add .either.data. + (.rodata2): Move some read-only data sections here. + (.text): Add .either.text. + (.rodata): Add .either.rodata. + (.bss): Add .either.bss. + * msp430/msp430xl-sim.ld (MEMORY): Add HIROM. + (.rodata2): Move some read-only data sections here. + (.upper.data): New section. Include notes about how to initialise + it. + 2015-04-21 Mike Frysinger * mcore/syscall.h: New header. diff --git a/libgloss/msp430/Makefile.in b/libgloss/msp430/Makefile.in index 286cd8963..fdd151344 100644 --- a/libgloss/msp430/Makefile.in +++ b/libgloss/msp430/Makefile.in @@ -57,8 +57,7 @@ OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ then echo ${objroot}/../binutils/objcopy ; \ else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` -SCRIPTS = $(srcdir)/msp430.ld -SCRIPTS += $(srcdir)/msp430-sim.ld +SCRIPTS = $(srcdir)/msp430-sim.ld SCRIPTS += $(srcdir)/msp430xl-sim.ld SCRIPTS += $(srcdir)/intr_vectors.ld @@ -84,6 +83,7 @@ CRT_OBJS = \ crt_bss.o \ crt_high_bss.o \ crt_movedata.o \ + crt_move_highdata.o \ crt_main.o \ crt_main_minrt.o \ crt_callexit.o \ diff --git a/libgloss/msp430/crt0.S b/libgloss/msp430/crt0.S index c511959d0..375d47639 100644 --- a/libgloss/msp430/crt0.S +++ b/libgloss/msp430/crt0.S @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2013 Red Hat, Inc. All rights reserved. +/* Copyright (c) 2012-2015 Red Hat, Inc. All rights reserved. This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions of the BSD @@ -14,37 +14,64 @@ #include "memmodel.h" ;; The linker links all .crt_* sections in asciibetical order at the -;; same place. So, the four digits in .crt_NNNN determine the link -;; order, so, keep them in sequential order here. The first two -;; digits are set here, the second two allow users to insert code -;; between code fragments here. +;; same place. So, the four digits in .crt_NNNN_xxx name created by +;; the START_CRT_FUNC macro determine the link order, so, keep them +;; in sequential order here. The first two digits are set here, the +;; second two allow users to insert code between code fragments here. #if L0 .section ".resetvec", "a" __msp430_resetvec_hook: - .word __start + .word __crt0_start - .section ".crt_0000init", "ax", @progbits + ;; Here we provide weak definitions of the symbols used in the + ;; init_highbss and move_highdata blocks, in case they are not + ;; provided by the linker script. They are defined here because + ;; this block is always included in every executable, and because + ;; if there were defined in the blocks that need them their values + ;; would be used without giving the linker script a chance to + ;; override them. + ;; + ;; The weak definitions are needed if the user targets an MCU + ;; without high memory - and hence uses a linker script without + ;; a definition of the .upper.bss or .upper.data sections - and + ;; they have compiled their code with the -mdata-region=either + ;; command line option. That option causes the assembler to + ;; define the __crt0_move_highdata and/or crt0_init_highbss + ;; symbols, which in turn forces the inclusion of the + ;; move_highdata and/or init_highbss blocks in the startup code, + ;; regardless of the fact that the sections are not present in + ;; the linker script. + + WEAK_DEF __upper_data_init + WEAK_DEF __rom_highdatacopysize + WEAK_DEF __high_datastart + WEAK_DEF __rom_highdatastart + WEAK_DEF __high_bssstart + WEAK_DEF __high_bsssize + +START_CRT_FUNC 0000 start .refsym __msp430_resetvec_hook #ifdef MINRT .refsym __crt0_call_just_main #else .refsym __crt0_call_init_then_main #endif - .global __start -__start: mov_ #__stack, R1 ;; Disable watchdog timer. MOV #0x5a80, &0x15C +END_CRT_FUNC start #endif -#if Lbss - .section ".crt_0100bss", "ax", @progbits - .global __crt0_init_bss -__crt0_init_bss: - +#if Lbss +;; Note - this section is only included in the startup code of the +;; application if it is needed. It is responsible for initializing +;; the contents of the .bss section. + +START_CRT_FUNC 0100 init_bss + mov_ #__bssstart, R12 clr.w R13 mov.w #__bsssize, R14 @@ -52,32 +79,41 @@ __crt0_init_bss: clr.w R15 ; We assume that __bsssize is never > 64M #endif call_ #memset -#endif + +END_CRT_FUNC init_bss +#endif /* Lbss */ + #ifdef __MSP430X_LARGE__ #if Lhigh_bss -;; Note - this section is only included in the -;; startup code of the application if it is needed. +;; Note - this section is only included in the startup code of the +;; application if it is needed. It is responsible for initializing +;; the contents of the .upper.bss section. - .section ".crt_0150high_bss", "ax", @progbits +START_CRT_FUNC 0200 init_highbss - .global __crt0_init_high_bss -__crt0_init_high_bss: - - mov_ #llo(__high_bssstart), R12 - mov_ #lhi(__high_bssstart), R13 - mov.w #llo(__high_bsssize), R14 - mov.w #lhi(__high_bsssize), R15 + mov_ #__high_bssstart, R12 + mov.w #0, R13 + mov_ #__high_bsssize, R14 + ;; If __high_bsssize is zero then skip the call to memset. + ;; This can happen if all of the bss data was placed into .either.bss. + cmp.w #0, R14 + jeq 1f call_ #memset +1: +END_CRT_FUNC init_highbss #endif /* Lhigh_bss */ #endif /* __MSP430X_LARGE__ */ -#if Lmovedata - .section ".crt_0200movedata", "ax", @progbits - .global __crt0_movedata -__crt0_movedata: - +#if Lmovedata +;; Note - this section is only included in the startup code of the +;; application if it is needed. It is responsible for copying the +;; contents of the .data section from its load address (in ROM) to +;; its run-time address (in RAM). + +START_CRT_FUNC 0300 movedata + mov_ #__datastart, R12 mov_ #__romdatastart, R13 @@ -85,44 +121,104 @@ __crt0_movedata: cmp_ R12, R13 jeq 1f - mov.w #__romdatacopysize, R14 -#ifdef __MSP430X_LARGE__ - clr.w R15 ; We assume that __romdatacopysize is never > 64M -#endif + mov_ #__romdatacopysize, R14 + call_ #memmove -1: -#endif +1: +END_CRT_FUNC movedata +#endif /* Lmovedata */ + + +#ifdef __MSP430X_LARGE__ +#if Lmove_highdata +;; Note - this section is only included in the startup code of the application +;; if it is needed. It is responsible either for making sure that the +;; contents of the .upper.data section have their correct startup values. +;; If a copy of the .upper.data section is stored in ROM then this means +;; copying the contents into HIFRAM. If a copy of .upper.data is stored in a +;; shadow section in HIFRAM then this means copying from the shadow section +;; into the real section. + +START_CRT_FUNC 0400 move_highdata + ;; __rom_highdatacopysize may be zero. Test this first because + ;; its value may come from the weak definitions above and we do + ;; not want to access the memory at address 0 pointed to by the + ;; weak definition of __upper_data_init. + mov.w #__rom_highdatacopysize, R14 + cmp.w #0, R14 + jeq 3f + + /* Test our status word. */ + cmpx.w #0, &__upper_data_init + jeq 1f + /* Status word is non-zero - copy from shadow into upper. */ + mov_ #__high_datastart, R12 + mov_ #__rom_highdatastart, R13 + jmp 2f + +1: /* Status word is zero. Copy from upper to shadow and change status word. */ + movx.w #1, &__upper_data_init + mov_ #__rom_highdatastart, R12 + mov_ #__high_datastart, R13 + +2: ;; __rom_highdatacopysize may be zero. memmove should cope. + mov.w #__rom_highdatacopysize, R14 + + call_ #memmove +3: +END_CRT_FUNC move_highdata +#endif /* Lmove_highdata */ +#endif /* __MSP430X_LARGE__ */ + #if Lmain_minrt - .section ".crt_0300main", "ax", @progbits - .global __crt0_call_just_main -__crt0_call_just_main: +;; Note - this section is only included in the startup code of the +;; application if it is needed. It is responsible for just calling +;; main. No initialization code is called first, and main is not +;; expected to return. + +START_CRT_FUNC 0600 call_just_main + clr.w R12 ; Set argc == 0 call_ #main -#endif +END_CRT_FUNC call_just_main +#endif /* Lmain_minrt */ + #if Lmain - .section ".crt_0300main", "ax", @progbits - .global __crt0_call_init_then_main -__crt0_call_init_then_main: +;; Note - this section is only included in the startup code of the +;; application if it is needed. It is responsible for calling the +;; initialization code - constructors, etc - and then main. If main +;; returns then the following section should be present to catch it. + +START_CRT_FUNC 0700 call_init_then_main + call_ #__msp430_init clr.w R12 ; Set argc == 0 call_ #main -#endif + +END_CRT_FUNC call_init_then_main +#endif /* Lmain */ + #if Lcallexit - .section ".crt_0400main_exit", "ax", @progbits - .global __crt0_call_exit -__crt0_call_exit: +;; Note - this section is only included in the startup code of the +;; application if it is needed. It is responsible for calling exit +;; once main has finished. + +START_CRT_FUNC 0800 call_exit + call_ #_exit -#endif + +END_CRT_FUNC call_exit +#endif /* Lcallexit */ ;---------------------------------------- #ifndef MINRT #if L0 - .section ".crt_0500main_init", "ax", @progbits + .section ".crt_0900main_init", "ax", @progbits .global _msp430_run_init_array .type _msp430_run_init_array,@function _msp430_run_init_array: @@ -172,4 +268,4 @@ __msp430_fini: call_ #_msp430_run_fini_array #endif -#endif +#endif /* not MINRT */ diff --git a/libgloss/msp430/crt_movedata.S b/libgloss/msp430/crt_movedata.S deleted file mode 100644 index ad9fa2799..000000000 --- a/libgloss/msp430/crt_movedata.S +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (c) 2012-2013 Red Hat Incorporated. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - The name of Red Hat Incorporated may not be used to endorse - or promote products derived from this software without specific - prior written permission. - - This software is provided by the copyright holders and contributors - "AS IS" and any express or implied warranties, including, but not - limited to, the implied warranties of merchantability and fitness for - a particular purpose are disclaimed. In no event shall Red Hat - incorporated be liable for any direct, indirect, incidental, special, - exemplary, or consequential damages (including, but not limited to, - procurement of substitute goods or services; loss of use, data, or - profits; or business interruption) however caused and on any theory of - liability, whether in contract, strict liability, or tort (including - negligence or otherwise) arising in any way out of the use of this - software, even if advised of the possibility of such damage. */ - -#include "memmodel.h" - - .section ".crt_movedata", "ax", @progbits - - .global __crt0_movedata -__crt0_movedata: - - mov_ #__datastart, R12 - mov_ #__romdatastart, R13 - - ;; memmove and memcpy do not currently work when src == dst - cmp_ R12, R13 - jeq 1f - - mov.w #__romdatacopysize, R14 -#ifdef __MSP430X_LARGE__ - clr.w R15 ; We assume that __romdatacopysize is never > 64M -#endif - call_ #memmove -1: diff --git a/libgloss/msp430/memmodel.h b/libgloss/msp430/memmodel.h index 4804e17dd..a481460c6 100644 --- a/libgloss/msp430/memmodel.h +++ b/libgloss/msp430/memmodel.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2013 Red Hat, Inc. All rights reserved. +/* Copyright (c) 2012-2015 Red Hat, Inc. All rights reserved. This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions of the BSD @@ -37,5 +37,30 @@ #define add_ ADD #define PTRsz 2 - #endif + +/* Start a function in its own named and numbered section, so that it + can be subject to linker garbage collection. The numbers are used + to enforce link-time ordering of the sections. Note - the construction + of the symbol names is critical - they need to match the unresolved + symbol references created by the compiler and assembler. */ +.macro START_CRT_FUNC number name + .section .crt_\number\name,"ax",@progbits + .global __crt0_\name + .type __crt0_\name , @function +__crt0_\name: +.endm + + +/* End a named function. Sets the size so that GDB does not get confused. */ +.macro END_CRT_FUNC name + .size __crt0_\name, . - __crt0_\name +.endm + + +/* Provide a weak definition of NAME, initialized to zero. */ +.macro WEAK_DEF name + .global \name + .weak \name + \name = 0 +.endm diff --git a/libgloss/msp430/msp430-sim.ld b/libgloss/msp430/msp430-sim.ld index 01b3f217c..6147cbe72 100644 --- a/libgloss/msp430/msp430-sim.ld +++ b/libgloss/msp430/msp430-sim.ld @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014 Red Hat, Inc. All rights reserved. +/* Copyright (c) 2013-2015 Red Hat, Inc. All rights reserved. This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions of the BSD @@ -33,11 +33,15 @@ SECTIONS { . = ALIGN(2); *(.plt) + . = ALIGN(2); *(.lower.rodata.* .lower.rodata) + . = ALIGN(2); *(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*) + . = ALIGN(2); + *(.either.rodata.* .either.rodata) + . = ALIGN(2); *(.rodata1) - *(.eh_frame_hdr) - KEEP (*(.eh_frame)) + KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) PROVIDE (__preinit_array_start = .); KEEP (*(.preinit_array)) @@ -52,6 +56,17 @@ SECTIONS PROVIDE (__fini_array_end = .); LONG(0); /* Sentinel. */ + } > RAM + + /* Note: This is a separate .rodata section for sections which are + read only but which older linkers treat as read-write. + This prevents older linkers from marking the entire .rodata + section as read-write. */ + .rodata2 : { + . = ALIGN(2); + *(.eh_frame_hdr) + KEEP (*(.eh_frame)) + /* gcc uses crtbegin.o to find the start of the constructors, so we make sure it is first. Because this is a wildcard, it doesn't matter if the user does not actually link against @@ -80,8 +95,9 @@ SECTIONS PROVIDE (_start = .); KEEP (*(SORT(.crt_*))) *(.lowtext) - *(.lower.text.* .lower.text) + *(.lower.text.* .lower.text) *(.text .stub .text.* .gnu.linkonce.t.* .text:*) + *(.either.text.* .either.text) KEEP (*(.text.*personality*)) /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) @@ -101,11 +117,15 @@ SECTIONS PROVIDE (__datastart = .); *(.lower.data.* .lower.data) + + *(.data .data.* .gnu.linkonce.d.*) + + *(.either.data.* .either.data) + KEEP (*(.jcr)) *(.data.rel.ro.local) *(.data.rel.ro*) *(.dynamic) - *(.data .data.* .gnu.linkonce.d.*) KEEP (*(.gnu.linkonce.d.*personality*)) SORT(CONSTRUCTORS) *(.data1) @@ -136,6 +156,7 @@ SECTIONS *(.dynbss) *(.sbss .sbss.*) *(.bss .bss.* .gnu.linkonce.b.*) + *(.either.bss.* .either.bss) PROVIDE (__bssend = .); } > RAM PROVIDE (__bsssize = SIZEOF(.bss)); @@ -167,7 +188,7 @@ SECTIONS *(.upper.data.* .upper.data) *(.upper.bss.* .upper.bss) *(.upper.text.* .upper.text) - ASSERT (SIZEOF(.upper) == 0, ".upper sections present in a binary linked without -mlarge support"); + ASSERT (SIZEOF(.upper) == 0, "This MCU does not support high memory"); } /* The rest are all not normally part of the runtime image. */ diff --git a/libgloss/msp430/msp430.ld b/libgloss/msp430/msp430.ld deleted file mode 100644 index 022018600..000000000 --- a/libgloss/msp430/msp430.ld +++ /dev/null @@ -1,200 +0,0 @@ -/* Copyright (c) 2005,2008,2009,2011,2013 Red Hat, Inc. All rights reserved. - - This copyrighted material is made available to anyone wishing to use, modify, - copy, or redistribute it subject to the terms and conditions of the BSD - License. This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license - is available at http://www.opensource.org/licenses. Any Red Hat trademarks that - are incorporated in the source code or documentation are not subject to the BSD - License and may only be used or replicated with the express permission of - Red Hat, Inc. -*/ - -/* Default linker script, for normal executables */ -OUTPUT_ARCH(msp430) -ENTRY(_start) - -/* Do we need any of these for elf? - __DYNAMIC = 0; */ - -INCLUDE intr_vectors.ld - -MEMORY { - RAM (w) : ORIGIN = 0x00200, LENGTH = 0x0ee00 - RESETVEC (w) : ORIGIN = 0x0fffe, LENGTH = 0x00002 -} - -SECTIONS -{ - .resetvec : - { - *(.resetvec) - } > RESETVEC - - .rodata : { - . = ALIGN(2); - *(.plt) - *(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*) - *(.rodata1) - *(.eh_frame_hdr) - KEEP (*(.eh_frame)) - KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) - PROVIDE (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE (__preinit_array_end = .); - PROVIDE (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array)) - PROVIDE (__init_array_end = .); - PROVIDE (__fini_array_start = .); - KEEP (*(.fini_array)) - KEEP (*(SORT(.fini_array.*))) - PROVIDE (__fini_array_end = .); - LONG(0); /* Sentinel. */ - - /* gcc uses crtbegin.o to find the start of the constructors, so - we make sure it is first. Because this is a wildcard, it - doesn't matter if the user does not actually link against - crtbegin.o; the linker won't look for a file to match a - wildcard. The wildcard also means that it doesn't matter which - directory crtbegin.o is in. */ - KEEP (*crtbegin*.o(.ctors)) - - /* We don't want to include the .ctor section from from the - crtend.o file until after the sorted ctors. The .ctor section - from the crtend file contains the end of ctors marker and it - must be last */ - KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - - KEEP (*crtbegin*.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } > RAM - - .text : - { - . = ALIGN(2); - PROVIDE (_start = .); - KEEP (*(SORT(.crt_*))) - *(.lowtext .text .stub .text.* .gnu.linkonce.t.* .text:*) - KEEP (*(.text.*personality*)) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.interp .hash .dynsym .dynstr .gnu.version*) - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - . = ALIGN(2); - KEEP (*(.init)) - KEEP (*(.fini)) - KEEP (*(.tm_clone_table)) - } > RAM - - .data : { - . = ALIGN(2); - PROVIDE (__datastart = .); - - KEEP (*(.jcr)) - *(.data.rel.ro.local) *(.data.rel.ro*) - *(.dynamic) - - *(.data .data.* .gnu.linkonce.d.*) - KEEP (*(.gnu.linkonce.d.*personality*)) - SORT(CONSTRUCTORS) - *(.data1) - *(.got.plt) *(.got) - - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - . = ALIGN(2); - *(.sdata .sdata.* .gnu.linkonce.s.* D_2 D_1) - - . = ALIGN(2); - _edata = .; - PROVIDE (edata = .); - PROVIDE (__dataend = .); - } > RAM - - /* Note that crt0 assumes this is a multiple of two; all the - start/stop symbols are also assumed word-aligned. */ - PROVIDE(__romdatastart = LOADADDR(.data)); - PROVIDE (__romdatacopysize = SIZEOF(.data)); - - .bss : { - . = ALIGN(2); - PROVIDE (__bssstart = .); - *(.dynbss) - *(.sbss .sbss.*) - *(.bss .bss.* .gnu.linkonce.b.*) - PROVIDE (__bssend = .); - } > RAM - PROVIDE (__bsssize = SIZEOF(.bss)); - - /* This section contains data that is not initialised at startup. */ - .noinit : { - . = ALIGN(2); - PROVIDE (__noinit_start = .); - *(.noinit) - . = ALIGN(2); - *(COMMON) - PROVIDE (__noinit_end = .); - } > RAM - - _end = .; - PROVIDE (end = .); - - .stack (ORIGIN (RAM) + LENGTH(RAM)) : - { - PROVIDE (__stack = .); - *(.stack) - } - - .MP430.attributes 0 : - { - KEEP (*(.MSP430.attributes)) - KEEP (*(.gnu.attributes)) - KEEP (*(__TI_build_attributes)) - } - - /* The rest are all not normally part of the runtime image. */ - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - /DISCARD/ : { *(.note.GNU-stack) } -} diff --git a/libgloss/msp430/msp430F5438A-l.ld b/libgloss/msp430/msp430F5438A-l.ld deleted file mode 100644 index 2e9cab636..000000000 --- a/libgloss/msp430/msp430F5438A-l.ld +++ /dev/null @@ -1,220 +0,0 @@ -/* Copyright (c) 2013 Red Hat, Inc. All rights reserved. - - This copyrighted material is made available to anyone wishing to use, modify, - copy, or redistribute it subject to the terms and conditions of the BSD - License. This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license - is available at http://www.opensource.org/licenses. Any Red Hat trademarks that - are incorporated in the source code or documentation are not subject to the BSD - License and may only be used or replicated with the express permission of - Red Hat, Inc. -*/ - -/* Default linker script, for normal executables */ -OUTPUT_ARCH(msp430) -ENTRY(_start) - -INCLUDE intr_vectors.ld - -/* Do we need any of these for elf? - __DYNAMIC = 0; */ - -MEMORY -{ - RAM (w) : ORIGIN = 0x01c00, LENGTH = 0x04000 - LOWROM (w) : ORIGIN = 0x05c00, LENGTH = 0x0a3fe - RESETVEC (w) : ORIGIN = 0x0fffe, LENGTH = 0x00002 - ROM (w) : ORIGIN = 0x10000, LENGTH = 0x35c00 -} - -SECTIONS -{ - .resetvec : - { - *(.resetvec) - } > RESETVEC - - .rodata : { - . = ALIGN(2); - *(.plt) - *(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*) - *(.rodata1) - *(.eh_frame_hdr) - KEEP (*(.eh_frame)) - KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) - PROVIDE (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE (__preinit_array_end = .); - PROVIDE (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array)) - PROVIDE (__init_array_end = .); - PROVIDE (__fini_array_start = .); - KEEP (*(.fini_array)) - KEEP (*(SORT(.fini_array.*))) - PROVIDE (__fini_array_end = .); - LONG(0); /* Sentinel. */ - - /* gcc uses crtbegin.o to find the start of the constructors, so - we make sure it is first. Because this is a wildcard, it - doesn't matter if the user does not actually link against - crtbegin.o; the linker won't look for a file to match a - wildcard. The wildcard also means that it doesn't matter which - directory crtbegin.o is in. */ - KEEP (*crtbegin*.o(.ctors)) - - /* We don't want to include the .ctor section from from the - crtend.o file until after the sorted ctors. The .ctor section - from the crtend file contains the end of ctors marker and it - must be last */ - KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - - KEEP (*crtbegin*.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } > ROM - - .data : { - . = ALIGN(2); - PROVIDE (__datastart = .); - - KEEP (*(.jcr)) - *(.data.rel.ro.local) *(.data.rel.ro*) - *(.dynamic) - - *(.data .data.* .gnu.linkonce.d.*) - KEEP (*(.gnu.linkonce.d.*personality*)) - SORT(CONSTRUCTORS) - *(.data1) - *(.got.plt) *(.got) - - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - . = ALIGN(2); - *(.sdata .sdata.* .gnu.linkonce.s.* D_2 D_1) - - . = ALIGN(2); - _edata = .; - PROVIDE (edata = .); - PROVIDE (__dataend = .); - } > RAM AT>ROM - - /* Note that crt0 assumes this is a multiple of two; all the - start/stop symbols are also assumed word-aligned. */ - PROVIDE(__romdatastart = LOADADDR(.data)); - PROVIDE (__romdatacopysize = SIZEOF(.data)); - - .bss : { - . = ALIGN(2); - PROVIDE (__bssstart = .); - *(.dynbss) - *(.sbss .sbss.*) - *(.bss .bss.* .gnu.linkonce.b.*) - . = ALIGN(2); - PROVIDE (__bssend = .); - } > RAM - PROVIDE (__bsssize = SIZEOF(.bss)); - - /* This section contains data that is not initialised at startup. */ - .noinit : { - . = ALIGN(2); - PROVIDE (__noinit_start = .); - *(.noinit) - . = ALIGN(2); - *(COMMON) - PROVIDE (__noinit_end = .); - } > RAM - - _end = .; - PROVIDE (end = .); - - .stack (ORIGIN (RAM) + LENGTH(RAM)) : - { - PROVIDE (__stack = .); - *(.stack) - } - - /* This is just for crt0.S */ - .lowtext : - { - PROVIDE (_start = .); - . = ALIGN(2); - KEEP (*(.crt_init)) - KEEP (*(.crt_bss)) - KEEP (*(.crt_movedata)) - KEEP (*(.crt_main)) - KEEP (*(.lowtext)) - } > LOWROM - - .text : - { - . = ALIGN(2); - *(.text .stub .text.* .gnu.linkonce.t.* .text:*) - KEEP (*(.text.*personality*)) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.interp .hash .dynsym .dynstr .gnu.version*) - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - . = ALIGN(2); - KEEP (*(.init)) - KEEP (*(.fini)) - KEEP (*(.tm_clone_table)) - } > ROM - - /* The rest are all not normally part of the runtime image. */ - - .MP430.attributes 0 : - { - KEEP (*(.MSP430.attributes)) - KEEP (*(.gnu.attributes)) - KEEP (*(__TI_build_attributes)) - } - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - /* DWARF 3 */ - .debug_pubtypes 0 : { *(.debug_pubtypes) } - .debug_ranges 0 : { *(.debug_ranges) } - /* DWARF Extension. */ - .debug_macro 0 : { *(.debug_macro) } - - /DISCARD/ : { *(.note.GNU-stack) } -} diff --git a/libgloss/msp430/msp430F5438A-s.ld b/libgloss/msp430/msp430F5438A-s.ld deleted file mode 100644 index 4e9fc84b4..000000000 --- a/libgloss/msp430/msp430F5438A-s.ld +++ /dev/null @@ -1,206 +0,0 @@ -/* Copyright (c) 2005,2008,2009,2011,2013 Red Hat, Inc. All rights reserved. - - This copyrighted material is made available to anyone wishing to use, modify, - copy, or redistribute it subject to the terms and conditions of the BSD - License. This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license - is available at http://www.opensource.org/licenses. Any Red Hat trademarks that - are incorporated in the source code or documentation are not subject to the BSD - License and may only be used or replicated with the express permission of - Red Hat, Inc. -*/ - -/* Default linker script, for normal executables */ -OUTPUT_ARCH(msp430) -ENTRY(_start) - -INCLUDE intr_vectors.ld - -/* Do we need any of these for elf? - __DYNAMIC = 0; */ - -MEMORY -{ - RAM (w) : ORIGIN = 0x01c00, LENGTH = 0x04000 - ROM (w) : ORIGIN = 0x05c00, LENGTH = 0x0a3fe - RESETVEC (w) : ORIGIN = 0x0fffe, LENGTH = 0x00002 -} - -SECTIONS -{ - .resetvec : - { - *(.resetvec) - } > RESETVEC - - .rodata : { - . = ALIGN(2); - *(.plt) - *(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*) - *(.rodata1) - *(.eh_frame_hdr) - KEEP (*(.eh_frame)) - KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) - PROVIDE (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE (__preinit_array_end = .); - PROVIDE (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array)) - PROVIDE (__init_array_end = .); - PROVIDE (__fini_array_start = .); - KEEP (*(.fini_array)) - KEEP (*(SORT(.fini_array.*))) - PROVIDE (__fini_array_end = .); - LONG(0); /* Sentinel. */ - - /* gcc uses crtbegin.o to find the start of the constructors, so - we make sure it is first. Because this is a wildcard, it - doesn't matter if the user does not actually link against - crtbegin.o; the linker won't look for a file to match a - wildcard. The wildcard also means that it doesn't matter which - directory crtbegin.o is in. */ - KEEP (*crtbegin*.o(.ctors)) - - /* We don't want to include the .ctor section from from the - crtend.o file until after the sorted ctors. The .ctor section - from the crtend file contains the end of ctors marker and it - must be last */ - KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - - KEEP (*crtbegin*.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } > ROM - - .text : - { - . = ALIGN(2); - PROVIDE (_start = .); - KEEP (*(.crt_init)) - KEEP (*(.crt_bss)) - KEEP (*(.crt_movedata)) - KEEP (*(.crt_main)) - KEEP (*(.lowtext)) - *(.text .stub .text.* .gnu.linkonce.t.* .text:*) - KEEP (*(.text.*personality*)) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.interp .hash .dynsym .dynstr .gnu.version*) - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - . = ALIGN(2); - KEEP (*(.init)) - KEEP (*(.fini)) - KEEP (*(.tm_clone_table)) - } > ROM - - .data : { - . = ALIGN(2); - PROVIDE (__datastart = .); - - KEEP (*(.jcr)) - *(.data.rel.ro.local) *(.data.rel.ro*) - *(.dynamic) - - *(.data .data.* .gnu.linkonce.d.*) - KEEP (*(.gnu.linkonce.d.*personality*)) - SORT(CONSTRUCTORS) - *(.data1) - *(.got.plt) *(.got) - - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - . = ALIGN(2); - *(.sdata .sdata.* .gnu.linkonce.s.* D_2 D_1) - - . = ALIGN(2); - _edata = .; - PROVIDE (edata = .); - PROVIDE (__dataend = .); - } > RAM AT>ROM - - /* Note that crt0 assumes this is a multiple of two; all the - start/stop symbols are also assumed word-aligned. */ - PROVIDE(__romdatastart = LOADADDR(.data)); - PROVIDE (__romdatacopysize = SIZEOF(.data)); - - .bss : { - . = ALIGN(2); - PROVIDE (__bssstart = .); - *(.dynbss) - *(.sbss .sbss.*) - *(.bss .bss.* .gnu.linkonce.b.*) - PROVIDE (__bssend = .); - } > RAM - PROVIDE (__bsssize = SIZEOF(.bss)); - - /* This section contains data that is not initialised at startup. */ - .noinit : { - . = ALIGN(2); - PROVIDE (__noinit_start = .); - *(.noinit) - . = ALIGN(2); - *(COMMON) - PROVIDE (__noinit_end = .); - } > RAM - - _end = .; - PROVIDE (end = .); - - .stack (ORIGIN (RAM) + LENGTH(RAM)) : - { - PROVIDE (__stack = .); - *(.stack) - } - - .MP430.attributes 0 : - { - KEEP (*(.MSP430.attributes)) - KEEP (*(.gnu.attributes)) - KEEP (*(__TI_build_attributes)) - } - - /* The rest are all not normally part of the runtime image. */ - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - /DISCARD/ : { *(.note.GNU-stack) } -} diff --git a/libgloss/msp430/msp430xl-sim.ld b/libgloss/msp430/msp430xl-sim.ld index 31ff85a70..1dca58afb 100644 --- a/libgloss/msp430/msp430xl-sim.ld +++ b/libgloss/msp430/msp430xl-sim.ld @@ -1,27 +1,35 @@ -/* Copyright (c) 2013-2014 Red Hat, Inc. All rights reserved. +/* Copyright (c) 2013-2015 Red Hat, Inc. All rights reserved. - This copyrighted material is made available to anyone wishing to use, modify, - copy, or redistribute it subject to the terms and conditions of the BSD - License. This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license - is available at http://www.opensource.org/licenses. Any Red Hat trademarks that - are incorporated in the source code or documentation are not subject to the BSD - License and may only be used or replicated with the express permission of - Red Hat, Inc. */ + This copyrighted material is made available to anyone wishing to use, + modify, copy, or redistribute it subject to the terms and conditions of + the BSD License. This program is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY expressed or implied, including the + implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + A copy of this license is available at http://www.opensource.org/licenses. -/* Default linker script, for large MSP430X executables. */ + Any Red Hat trademarks that are incorporated in the source code or + documentation are not subject to the BSD License and may only be used or + replicated with the express permission of Red Hat, Inc. */ + +/* Example linker script, for large MSP430X executables. */ OUTPUT_ARCH(msp430) ENTRY(_start) INCLUDE intr_vectors.ld +/* Note - These memory regions are just examples. Real MSP430 MCUs will have + different varieties and sizes of RAM, ROM and FLASH. Not all devices will + have all of these regions either. Device specific linker scripts are + provided by TI, so this file is intended to be used as a guide and so that + toolchain tests can be run against the simulator. */ MEMORY { - RAM (w) : ORIGIN = 0x00200, LENGTH = 0x01e00 + RAM (rw) : ORIGIN = 0x00200, LENGTH = 0x01e00 ROM (rx) : ORIGIN = 0x02000, LENGTH = 0x0df00 - HIFRAM (rxw) : ORIGIN = 0x10000, LENGTH = 0x80000 + /* The regions from intr_vectors.ld go here. */ + HIFRAM (rw) : ORIGIN = 0x10000, LENGTH = 0x80000 + HIROM (rx) : ORIGIN = 0x90000, LENGTH = 0x70000 } SECTIONS @@ -31,22 +39,34 @@ SECTIONS *(.resetvec) } > VECT31 - .upper.rodata : - { - . = ALIGN(2); - *(.upper.rodata.* .upper.rodata) - } > HIFRAM - .rodata : { . = ALIGN(2); *(.plt) + + . = ALIGN(2); *(.lower.rodata.* .lower.rodata) + + /* Note: By default we do not have this line: + + *(.either.rodata.*) *(.either.rodata) + + defined here, or anywhere else in this script. This is deliberate. + The algorithm in the linker that automatically places rodata into + either the .rodata or the .upper.rodata sections relies upon the + fact that the .either.rodata section is not defined, and that the + .upper.rodata section is defined. If the .upper.rodata is not + defined in this script then the line above should be restored so that + code compiled with -mdata-region=either enabled will still work. + + The same reasoning applies to the absence of definitions for the + .either.text, .either.data and .either.bss sections as well. */ + + . = ALIGN(2); *(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*) *(.rodata1) - *(.eh_frame_hdr) - KEEP (*(.eh_frame)) + . = ALIGN(2); KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) PROVIDE (__preinit_array_start = .); KEEP (*(.preinit_array)) @@ -61,6 +81,17 @@ SECTIONS PROVIDE (__fini_array_end = .); LONG(0); /* Sentinel. */ + } > ROM + + /* Note: This is a separate .rodata section for sections which are + read only but which older linkers treat as read-write. + This prevents older linkers from marking the entire .rodata + section as read-write. */ + .rodata2 : { + . = ALIGN(2); + *(.eh_frame_hdr) + KEEP (*(.eh_frame)) + /* gcc uses crtbegin.o to find the start of the constructors, so we make sure it is first. Because this is a wildcard, it doesn't matter if the user does not actually link against @@ -83,11 +114,19 @@ SECTIONS KEEP (*(.dtors)) } > ROM - .upper.data : + .upper.rodata : { + /* Note: If this section is not defined then please add: + + *(.either.rodata.*) *(.either.rodata) + + to the definition of the .rodata section above. This + will allow code compiled with -mdata-region=either to + work properly. */ + . = ALIGN(2); - *(.upper.data.* .upper.data) - } > HIFRAM + *(.upper.rodata.* .upper.rodata) + } > HIROM .data : { @@ -100,7 +139,14 @@ SECTIONS *(.data.rel.ro.local) *(.data.rel.ro*) *(.dynamic) + . = ALIGN(2); *(.data .data.* .gnu.linkonce.d.*) + + /* See the note in .rodata section about why we do not have this line here: + + *(.either.data.* .either.data) + */ + KEEP (*(.gnu.linkonce.d.*personality*)) SORT(CONSTRUCTORS) *(.data1) @@ -113,24 +159,109 @@ SECTIONS *(.sdata .sdata.* .gnu.linkonce.s.* D_2 D_1) . = ALIGN(2); - _edata = .; PROVIDE (edata = .); PROVIDE (__dataend = .); - } > RAM - /* Note that crt0 assumes this is a multiple of two; all the - start/stop symbols are also assumed word-aligned. */ - PROVIDE(__romdatastart = LOADADDR(.data)); - PROVIDE (__romdatacopysize = SIZEOF(.data)); + /* See the comment in the .upper.data section about the need + to copy data from ROM into RAM at program start up. */ + } > RAM AT> ROM - .upper.bss : + /* Note that crt0 assumes that __romdatacopysize is a multiple of two. + All the start/stop symbols are also assumed to be word-aligned. */ + __romdatastart = LOADADDR(.data); + __romdatacopysize = SIZEOF(.data); + + /* ------------------- start of .upper.data sections.---------------- */ + /* Note: If both HIROM and HIFRAM are available then the .upper.data + section should look like this: + + . = ALIGN(2); + .upper.data : + { + __upper_data_init = LOADADDR (.upper.data); + /* Status word. * / + SHORT(1); + __high_datastart = .; + *(.upper.data.* .upper.data) + __high_dataend = .; + } > HIFRAM AT> HIROM + + __rom_highdatacopysize = SIZEOF(.upper.data) - 2; + __rom_highdatastart = LOADADDR(.upper.data) + 2; + + If only HIFRAM is available then the layout below must look like this: + + .upper.data : + { + . = ALIGN(2); + __high_datastart = .; + *(.upper.data.* .upper.data) + __high_dataend = .; + } > HIFRAM + + __rom_highdatacopysize = SIZEOF(.upper.data); + + .shadow.upper.data : + { + . = ALIGN(2); + __upper_data_init = .; + /* Status word. * / + SHORT(0); + /* Space for the copy of .upper.data. * / + . = . + SIZEOF(.upper.data) - 2; + } > HIFRAM + + __rom_highdatastart = LOADADDR(.shadow.upper.data) + 2; + + Note - remove the space in this sequence: * / (twice) when you copy one + of the script fragments above into your script. + + Note - the symbols defined here are *not* enclosed by the PROVIDE + keyword. This is deliberate. The crt0 library provides weak + definitions of these symbols and those weak definitions *must* be + overriden by the correct values. + + The status word is used to control how the .upper.data section + is initialized at application start up. If the word is non-zero + then data is copied from __rom_highdatastart to __high_datastart. + This corresponds with copying the contents of .upper.data from its + load address (HIROM) to its run-time address (HIFRAM) in the first + scenario, or from the .shadow.upper.section to the .upper.data in + the second scenario. + + If the status word is zero then the data is copied the other way + and the word is set to one. This only happens when the second + scenario is in play, and only the very first time the application + starts running. This makes sure that the .shadow.upper.data section + contains a pristine copy of the .upper.data section that can be used + to reinitialize the .upper.data section upon device reset. + + The status word is necessary as this allows us to have one routine + in crt0 that can handle either form of .upper.data layout. IE crt0 + is linker script agnostic. + + Note - if the .upper.data section is not going to be defined at all + then please add this line back into the .data section above: + + *(.either.data.* .either.data) + */ + + . = ALIGN(2); + .upper.data : { - . = ALIGN(2); - PROVIDE (__high_bssstart = .); - *(.upper.bss.* .upper.bss) - PROVIDE (__high_bssend = .); - } > HIFRAM + __upper_data_init = LOADADDR (.upper.data); + /* Status word. */ + SHORT(1); + __high_datastart = .; + *(.upper.data.* .upper.data) + __high_dataend = .; + } > HIFRAM AT> HIROM + + __rom_highdatacopysize = SIZEOF(.upper.data) - 2; + __rom_highdatastart = LOADADDR(.upper.data) + 2; + + /* ------------------- end of .upper.data sections.---------------- */ .bss : { @@ -140,53 +271,87 @@ SECTIONS *(.dynbss) *(.sbss .sbss.*) *(.bss .bss.* .gnu.linkonce.b.*) + /* See the note in .rodata section about why we do not have this line here: + + *(.either.bss.* .either.bss) + */ + . = ALIGN(2); + *(COMMON) . = ALIGN(2); PROVIDE (__bssend = .); } > RAM PROVIDE (__bsssize = SIZEOF(.bss)); - /* This section contains data that is not initialised at startup. */ + /* This section contains data that is not initialised at startup + *or* application reset. */ .noinit (NOLOAD) : { . = ALIGN(2); PROVIDE (__noinit_start = .); *(.noinit) . = ALIGN(2); - *(COMMON) PROVIDE (__noinit_end = .); } > RAM - _end = .; - PROVIDE (end = .); + .upper.bss : + { + /* Note - if this section is not going to be defined then please + add this line back into the definition of the .bss section above: + + *(.either.bss.* .either.bss) + */ + . = ALIGN(2); + __high_bssstart = .; + *(.upper.bss.* .upper.bss) + . = ALIGN(2); + __high_bssend = .; + } > HIFRAM - .stack (ORIGIN (HIFRAM) + LENGTH(HIFRAM)) : + /* We create this section so that "end" will always be in the + HIFRAM region (matching .stack below), even if the .upper.bss + section is empty. */ + .heap_start : + { + . = ALIGN(2); + _end = .; + PROVIDE (end = .); + LONG(0); + } > HIFRAM + + /* Note: We place the stack in HIFRAM because then there is less + chance that it will collide with allocated data in the RAM region. + In scripts targeted at real MCUs however it may be better to place + the stack and heap in RAM, as flash does have a limited number of + writes before failure. + + Note - if the location of .stack is changed, then be sure to change + the definition of .heap_start above as well. */ + .stack (ORIGIN (HIFRAM) + LENGTH (HIFRAM)) : { PROVIDE (__stack = .); - *(.stack) } - /* This is just for crt0.S and interrupt handlers. */ - .lowtext : - { - PROVIDE (_start = .); - . = ALIGN(2); - KEEP (*(SORT(.crt_*))) - KEEP (*(.lowtext)) - } > ROM - - .upper.text : - { - . = ALIGN(2); - *(.upper.text.* .upper.text) - } > HIFRAM - .text : { + PROVIDE (_start = .); + + . = ALIGN(2); + KEEP (*(SORT(.crt_*))) + + . = ALIGN(2); + KEEP (*(.lowtext)) + . = ALIGN(2); *(.lower.text.* .lower.text) + . = ALIGN(2); *(.text .stub .text.* .gnu.linkonce.t.* .text:*) + /* See the note in .rodata section about why we do not have this line here: + + *(.either.text.* .either.text) + */ + KEEP (*(.text.*personality*)) /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) @@ -200,6 +365,18 @@ SECTIONS KEEP (*(.tm_clone_table)) } > ROM + .upper.text : + { + /* Note - if this section is not going to be included in the script + then please add this line back into the definition of the .text + section above: + + *(.either.text.* .either.text) + */ + . = ALIGN(2); + *(.upper.text.* .upper.text) + } > HIROM + /* The rest are all not normally part of the runtime image. */ .MP430.attributes 0 : From d958183ba446d8c0bf55cdb5479b54a347b3439a Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 13 May 2015 09:34:37 +0100 Subject: [PATCH 095/109] Update signbit functions to work on targets where integers are only 16-bits. * libm/common/s_signbit.c (__signbitf): Fix for 16-bit targets. (__signbitd): Likewise. --- newlib/ChangeLog | 5 +++++ newlib/libm/common/s_signbit.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index e40d26bdf..d36decdd1 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2015-05-13 Nick Clifton + + * libm/common/s_signbit.c (__signbitf): Fix for 16-bit targets. + (__signbitd): Likewise. + 2015-05-02 Corinna Vinschen * libc/include/sys/time.h: Include sys/select.h on Cygwin. Explain why. diff --git a/newlib/libm/common/s_signbit.c b/newlib/libm/common/s_signbit.c index 746ab4662..6ea714dd3 100644 --- a/newlib/libm/common/s_signbit.c +++ b/newlib/libm/common/s_signbit.c @@ -41,19 +41,19 @@ int __signbitd (double x); int __signbitf (float x) { - unsigned int w; + __uint32_t w; GET_FLOAT_WORD(w,x); - return (w & 0x80000000); + return (w & 0x80000000) != 0; } int __signbitd (double x) { - unsigned int msw; + __uint32_t msw; GET_HIGH_WORD(msw, x); - return (msw & 0x80000000); + return (msw & 0x80000000) != 0; } From 068f669e49a1367660eb97aca9b0c9580e15d93e Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 18 May 2015 14:14:28 +0100 Subject: [PATCH 096/109] Add a check that the data area does not overrun the stack. * msp430/msp430-sim.ld (.stack): Add an assertion to make sure that the data area does not overrun the stack. PROVIDE a new symbol __stack_size to allow the user to set the limit. * msp430/msp430xl-sim.ld (.stack): Likewise. * rl78/rl78-sim.ld (.stack): Likewise. * rl78/rl78.ld (.stack): Likewise. * rx/rx-sim.ld (.stack): Likewise. * rx/rx.ld (.stack): Likewise. --- libgloss/ChangeLog | 11 +++++++++++ libgloss/msp430/msp430-sim.ld | 16 ++++++++++++++++ libgloss/msp430/msp430xl-sim.ld | 18 +++++++++++++++++- libgloss/rl78/rl78-sim.ld | 16 ++++++++++++++++ libgloss/rl78/rl78.ld | 16 ++++++++++++++++ libgloss/rx/rx-sim.ld | 18 +++++++++++++++++- libgloss/rx/rx.ld | 18 +++++++++++++++++- 7 files changed, 110 insertions(+), 3 deletions(-) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 5c96c23e8..9988189be 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,14 @@ +2015-05-18 Nick Clifton + + * msp430/msp430-sim.ld (.stack): Add an assertion to make sure + that the data area does not overrun the stack. PROVIDE a new + symbol __stack_size to allow the user to set the limit. + * msp430/msp430xl-sim.ld (.stack): Likewise. + * rl78/rl78-sim.ld (.stack): Likewise. + * rl78/rl78.ld (.stack): Likewise. + * rx/rx-sim.ld (.stack): Likewise. + * rx/rx.ld (.stack): Likewise. + 2015-05-05 Nick Clifton * msp430/msp430.ld: Delete. diff --git a/libgloss/msp430/msp430-sim.ld b/libgloss/msp430/msp430-sim.ld index 6147cbe72..39fb67f7a 100644 --- a/libgloss/msp430/msp430-sim.ld +++ b/libgloss/msp430/msp430-sim.ld @@ -175,10 +175,26 @@ SECTIONS _end = .; PROVIDE (end = .); + /* The __stack_size value of 0x100 is just a guess, but since it is + PROVIDEd the user can override it on the command line. It has to be + set here, rather than inside the .stack section, as symbols defined + inside sections are only evaluated during the final phase of the link, + long after the ASSERT is checked. An ASSERT referencing a PROVIDED but + not yet evaluated symbol will automatically fail. + + FIXME: It would be nice if this value could be automatically set via + gcc's -fstack-usage command line option somehow. */ + PROVIDE (__stack_size = 0x100); + .stack (ORIGIN (RAM) + LENGTH(RAM)) : { PROVIDE (__stack = .); *(.stack) + + /* Linker section checking ignores empty sections like + this one so we have to have our own test here. */ + ASSERT ((__stack > (_end + __stack_size)), + "Error: Too much data - no room left for the stack"); } /* Make sure that .upper sections are not used without -mlarge support. */ diff --git a/libgloss/msp430/msp430xl-sim.ld b/libgloss/msp430/msp430xl-sim.ld index 1dca58afb..d59cdbf48 100644 --- a/libgloss/msp430/msp430xl-sim.ld +++ b/libgloss/msp430/msp430xl-sim.ld @@ -61,7 +61,7 @@ SECTIONS The same reasoning applies to the absence of definitions for the .either.text, .either.data and .either.bss sections as well. */ - + . = ALIGN(2); *(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*) *(.rodata1) @@ -318,6 +318,17 @@ SECTIONS LONG(0); } > HIFRAM + /* The __stack_size value of 0x100 is just a guess, but since it is + PROVIDEd the user can override it on the command line. It has to be + set here, rather than inside the .stack section, as symbols defined + inside sections are only evaluated during the final phase of the link, + long after the ASSERT is checked. An ASSERT referencing a PROVIDED but + not yet evaluated symbol will automatically fail. + + FIXME: It would be nice if this value could be automatically set via + gcc's -fstack-usage command line option somehow. */ + PROVIDE (__stack_size = 0x100); + /* Note: We place the stack in HIFRAM because then there is less chance that it will collide with allocated data in the RAM region. In scripts targeted at real MCUs however it may be better to place @@ -329,6 +340,11 @@ SECTIONS .stack (ORIGIN (HIFRAM) + LENGTH (HIFRAM)) : { PROVIDE (__stack = .); + + /* Linker section checking ignores empty sections like + this one so we have to have our own test here. */ + ASSERT ((__stack > (_end + __stack_size)), + "Error: Too much data - no room left for the stack"); } .text : diff --git a/libgloss/rl78/rl78-sim.ld b/libgloss/rl78/rl78-sim.ld index 26d62ac40..49442d11e 100644 --- a/libgloss/rl78/rl78-sim.ld +++ b/libgloss/rl78/rl78-sim.ld @@ -122,10 +122,26 @@ SECTIONS } > RAM PROVIDE (__bsssize = SIZEOF(.bss)); + /* The __stack_size value of 0x100 is just a guess, but since it is + PROVIDEd the user can override it on the command line. It has to be + set here, rather than inside the .stack section, as symbols defined + inside sections are only evaluated during the final phase of the link, + long after the ASSERT is checked. An ASSERT referencing a PROVIDED but + not yet evaluated symbol will automatically fail. + + FIXME: It would be nice if this value could be automatically set via + gcc's -fstack-usage command line option somehow. */ + PROVIDE (__stack_size = 0x100); + .stack (ORIGIN (STACK)) : { PROVIDE (__stack = .); *(.stack) + + /* Linker section checking ignores empty sections like + this one so we have to have our own test here. */ + ASSERT ((__stack > (_end + __stack_size)), + "Error: Too much data - no room left for the stack"); } .saddr : { diff --git a/libgloss/rl78/rl78.ld b/libgloss/rl78/rl78.ld index d560b1409..271104af2 100644 --- a/libgloss/rl78/rl78.ld +++ b/libgloss/rl78/rl78.ld @@ -122,10 +122,26 @@ SECTIONS } > RAM PROVIDE (__bsssize = SIZEOF(.bss)); + /* The __stack_size value of 0x100 is just a guess, but since it is + PROVIDEd the user can override it on the command line. It has to be + set here, rather than inside the .stack section, as symbols defined + inside sections are only evaluated during the final phase of the link, + long after the ASSERT is checked. An ASSERT referencing a PROVIDED but + not yet evaluated symbol will automatically fail. + + FIXME: It would be nice if this value could be automatically set via + gcc's -fstack-usage command line option somehow. */ + PROVIDE (__stack_size = 0x100); + .stack (ORIGIN (STACK)) : { PROVIDE (__stack = .); *(.stack) + + /* Linker section checking ignores empty sections like + this one so we have to have our own test here. */ + ASSERT ((__stack > (_end + __stack_size)), + "Error: Too much data - no room left for the stack"); } .saddr : { diff --git a/libgloss/rx/rx-sim.ld b/libgloss/rx/rx-sim.ld index b5802c511..a9bbf1fec 100644 --- a/libgloss/rx/rx-sim.ld +++ b/libgloss/rx/rx-sim.ld @@ -155,10 +155,26 @@ SECTIONS } > RAM PROVIDE (__bsssize = SIZEOF(.bss) / 4); + /* The __stack_size value of 0x100 is just a guess, but since it is + PROVIDEd the user can override it on the command line. It has to be + set here, rather than inside the .stack section, as symbols defined + inside sections are only evaluated during the final phase of the link, + long after the ASSERT is checked. An ASSERT referencing a PROVIDED but + not yet evaluated symbol will automatically fail. + + FIXME: It would be nice if this value could be automatically set via + gcc's -fstack-usage command line option somehow. */ + PROVIDE (__stack_size = 0x100); + .stack (ORIGIN (STACK)) : { PROVIDE (__stack = .); *(.stack) + + /* Linker section checking ignores empty sections like + this one so we have to have our own test here. */ + ASSERT ((__stack > (_end + __stack_size)), + "Error: Too much data - no room left for the stack"); } > STACK /* Providing one of these symbols in your code is sufficient to have @@ -213,7 +229,7 @@ SECTIONS /* DWARF 2 */ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } + .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) } .debug_frame 0 : { *(.debug_frame) } .debug_str 0 : { *(.debug_str) } .debug_loc 0 : { *(.debug_loc) } diff --git a/libgloss/rx/rx.ld b/libgloss/rx/rx.ld index f56fe01ea..1a56d8daf 100644 --- a/libgloss/rx/rx.ld +++ b/libgloss/rx/rx.ld @@ -159,10 +159,26 @@ SECTIONS } > RAM PROVIDE (__bsssize = SIZEOF(.bss) / 4); + /* The __stack_size value of 0x100 is just a guess, but since it is + PROVIDEd the user can override it on the command line. It has to be + set here, rather than inside the .stack section, as symbols defined + inside sections are only evaluated during the final phase of the link, + long after the ASSERT is checked. An ASSERT referencing a PROVIDED but + not yet evaluated symbol will automatically fail. + + FIXME: It would be nice if this value could be automatically set via + gcc's -fstack-usage command line option somehow. */ + PROVIDE (__stack_size = 0x100); + .stack (ORIGIN (STACK)) : { PROVIDE (__stack = .); *(.stack) + + /* Linker section checking ignores empty sections like + this one so we have to have our own test here. */ + ASSERT ((__stack > (_end + __stack_size)), + "Error: Too much data - no room left for the stack"); } /* Providing one of these symbols in your code is sufficient to have @@ -217,7 +233,7 @@ SECTIONS /* DWARF 2 */ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } + .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) } .debug_frame 0 : { *(.debug_frame) } .debug_str 0 : { *(.debug_str) } .debug_loc 0 : { *(.debug_loc) } From f4d7fbe5a1cd2e53ac2bfc3e96be38d3f2d1e650 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 26 May 2015 15:19:13 -0400 Subject: [PATCH 097/109] Fix interrupt handling for or1k. - During interrupt handling the PICSR, table pointers and current interrupt line have been saved in incorrect registers and/or stored on the stack. - Save the pointer in r16/r18, PICSR in r20 and the current interrupt line in r22. Those are callee-saved registers, so that the register values will be preserved. * or1k/interruts-asm.S: Change registers to callee-saved. --- libgloss/ChangeLog | 4 +++ libgloss/or1k/interrupts-asm.S | 52 ++++++++++++++++------------------ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 9988189be..1ca803fcb 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,7 @@ +2015-05-26 Stefan Wallentowitz + + * or1k/interruts-asm.S: Change registers to callee-saved. + 2015-05-18 Nick Clifton * msp430/msp430-sim.ld (.stack): Add an assertion to make sure diff --git a/libgloss/or1k/interrupts-asm.S b/libgloss/or1k/interrupts-asm.S index 560035285..82b796f51 100644 --- a/libgloss/or1k/interrupts-asm.S +++ b/libgloss/or1k/interrupts-asm.S @@ -38,49 +38,51 @@ .type _or1k_interrupt_handler,@function _or1k_interrupt_handler: - /* Make room on stack, save link register */ - l.addi r1,r1,-12 + /* Make room on stack, save link address register */ + l.addi r1,r1,-4 l.sw 0(r1),r9 /* Read PICSR */ - l.mfspr r3,r0,OR1K_SPR_PIC_PICSR_ADDR + l.mfspr r20,r0,OR1K_SPR_PIC_PICSR_ADDR /* Load handler table base address */ - l.movhi r7,hi(_or1k_interrupt_handler_table) - l.ori r7,r7,lo(_or1k_interrupt_handler_table) + // Needs to be callee-saved register + l.movhi r16,hi(_or1k_interrupt_handler_table) + l.ori r16,r16,lo(_or1k_interrupt_handler_table) /* Load data pointer table base address */ - l.movhi r12,hi(_or1k_interrupt_handler_data_ptr_table) - l.ori r12,r12,lo(_or1k_interrupt_handler_data_ptr_table) + // Needs to be callee-saved register + l.movhi r18,hi(_or1k_interrupt_handler_data_ptr_table) + l.ori r18,r18,lo(_or1k_interrupt_handler_data_ptr_table) #ifdef __OR1K_MULTICORE__ /* Read the addresses of the arrays of cores */ /* r7 = (*or1k_interrupt_handler_table) */ - l.lwz r7,0(r7) + l.lwz r16,0(r16) /* r12 = (*or1k_interrupt_handler_data_ptr_table) */ - l.lwz r12,0(r12) + l.lwz r18,0(r18) /* Generate offset in arrays */ /* r14 = coreid */ l.mfspr r14,r0,OR1K_SPR_SYS_COREID_ADDR /* r14 = coreid*32*4 = off */ l.slli r14,r14,7 /* r7 = (*or1k_exception_handler_table)[coreid] */ - l.add r7,r7,r14 + l.add r16,r16,r14 /* r12 = (*or1k_exception_handler_table)[coreid] */ - l.add r12,r12,r14 + l.add r18,r18,r14 #endif .L0: /* Find first set bit in PICSR */ - l.ff1 r4,r3 + l.ff1 r4,r20 /* Any bits set? */ l.sfne r4,r0 /* If none, finish */ OR1K_DELAYED_NOP(OR1K_INST(l.bnf .L2)) /* What is IRQ function table offset? */ - l.addi r5,r4,-1 - l.slli r6,r5,2 + l.addi r22,r4,-1 + l.slli r6,r22,2 /* Add this to table bases */ - l.add r14,r6,r7 - l.add r13,r6,r12 + l.add r14,r6,r16 + l.add r13,r6,r18 /* Fetch handler function address */ l.lwz r14,0(r14) @@ -90,33 +92,27 @@ _or1k_interrupt_handler: /* Skip if no handler: TODO: Indicate interrupt fired but no handler*/ OR1K_DELAYED_NOP(OR1K_INST(l.bnf .L1)) - /* Pull out data pointer from table, save r3, we'll write over it */ - l.sw 4(r1),r3 - l.lwz r3,0(r13) - /* Call handler, save r5 in delay slot */ + /* Call handler, load data pointer */ OR1K_DELAYED( - OR1K_INST(l.sw 8(r1),r5), + OR1K_INST(l.lwz r3,0(r13)), OR1K_INST(l.jalr r14) ) - /* Reload r3,r5 */ - l.lwz r3,4(r1) - l.lwz r5,8(r1) .L1: /* Clear bit from PICSR, return to start of checking loop */ l.ori r6,r0,1 - l.sll r6,r6,r5 + l.sll r6,r6,r22 OR1K_DELAYED( - OR1K_INST(l.xor r3,r3,r6), + OR1K_INST(l.xor r20,r20,r6), OR1K_INST(l.j .L0) ) .L2: /* Finish up - write PICSR back, restore r9*/ l.lwz r9,0(r1) - l.mtspr r0,r3,OR1K_SPR_PIC_PICSR_ADDR + l.mtspr r0,r20,OR1K_SPR_PIC_PICSR_ADDR OR1K_DELAYED( - OR1K_INST(l.addi r1,r1,12), + OR1K_INST(l.addi r1,r1,4), OR1K_INST(l.jr r9) ) From 3d4342d19389c433b85eaeb383ae924d918fa0c6 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 26 May 2015 15:21:52 -0400 Subject: [PATCH 098/109] Fix exception stack frame for or1k - We do not need a red zone here, as we do not operate on the current stack, but always use the clear exception stack. Also reserve two extra words for the context to store EPCR and ESR. * or1k/crt0.S: Fix exception stack frame * or1k/exception-asm.S: ditto --- libgloss/ChangeLog | 5 +++++ libgloss/or1k/crt0.S | 4 ++-- libgloss/or1k/exceptions-asm.S | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 1ca803fcb..adda15512 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,8 @@ +2015-05-26 Stefan Wallentowitz + + * or1k/crt0.S: Fix exception stack frame + * or1k/exception-asm.S: ditto + 2015-05-26 Stefan Wallentowitz * or1k/interruts-asm.S: Change registers to callee-saved. diff --git a/libgloss/or1k/crt0.S b/libgloss/or1k/crt0.S index f1753d0d7..ecaf9172f 100644 --- a/libgloss/or1k/crt0.S +++ b/libgloss/or1k/crt0.S @@ -61,10 +61,10 @@ // Reserved stack size for exceptions (can usually be smaller than normal stack) #define EXCEPTION_STACK_SIZE 8192 -// Size of redzone + size of space required to store state +// Size of space required to store state // This value must match that in the support library or1k_exception_handler // function -#define EXCEPTION_STACK_FRAME (128+128) +#define EXCEPTION_STACK_FRAME 136 .extern _or1k_stack_top /* points to the next address after the stack */ .extern _or1k_stack_bottom /* points to the last address in the stack */ diff --git a/libgloss/or1k/exceptions-asm.S b/libgloss/or1k/exceptions-asm.S index 7248683f5..762a509a9 100644 --- a/libgloss/or1k/exceptions-asm.S +++ b/libgloss/or1k/exceptions-asm.S @@ -24,7 +24,7 @@ */ /* -------------------------------------------------------------------------- */ // Warning - this must be the same as specified in crt0.S -#define EXCEPTION_STACK_SIZE 128+128 +#define EXCEPTION_STACK_SIZE 136 .extern _or1k_exception_handler_table From 40c0aa9cad73c4d87091f91da02d8a601caa0b68 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 26 May 2015 15:23:39 -0400 Subject: [PATCH 099/109] Store entire context for or1k - Store the exception program counter (from EPCR) and exception status register (from ESR) also during the exception. A runtime system may replace them thereby to implement a thread switch. * or1k/exception-asm.S: Store missing state --- libgloss/ChangeLog | 4 ++++ libgloss/or1k/exceptions-asm.S | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index adda15512..1dc57b6a5 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,7 @@ +2015-05-26 Stefan Wallentowitz + + * or1k/exception-asm.S: Store missing state + 2015-05-26 Stefan Wallentowitz * or1k/crt0.S: Fix exception stack frame diff --git a/libgloss/or1k/exceptions-asm.S b/libgloss/or1k/exceptions-asm.S index 762a509a9..91a2d8972 100644 --- a/libgloss/or1k/exceptions-asm.S +++ b/libgloss/or1k/exceptions-asm.S @@ -73,6 +73,10 @@ _or1k_exception_handler: l.sw GPR_BUF_OFFSET(29)(r1),r29 l.sw GPR_BUF_OFFSET(30)(r1),r30 l.sw GPR_BUF_OFFSET(31)(r1),r31 + l.mfspr r14,r0,OR1K_SPR_SYS_EPCR_BASE + l.sw 0x80(r1),r14 + l.mfspr r14,r0,OR1K_SPR_SYS_ESR_BASE + l.sw 0x84(r1),r14 /* Replace impure pointer for exception */ l.movhi r20,hi(_or1k_exception_impure_ptr) @@ -156,6 +160,12 @@ _or1k_exception_handler: l.sw 0(r21),r20 /* Restore state */ + l.lwz r2,0x80(r1) + l.mtspr r0,r2,OR1K_SPR_SYS_EPCR_BASE + + l.lwz r2,0x84(r1) + l.mtspr r0,r2,OR1K_SPR_SYS_ESR_BASE + l.lwz r2,GPR_BUF_OFFSET(2)(r1) l.lwz r3,GPR_BUF_OFFSET(3)(r1) l.lwz r4,GPR_BUF_OFFSET(4)(r1) From 67a2ed864a793ed574b465540cdaae6c5bf5e286 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 26 May 2015 15:25:13 -0400 Subject: [PATCH 100/109] Bug fix in timer for or1k - Properly set the interrupt pending flag in the timer mode register. * or1k/timer.c: Properly set interrupt flags --- libgloss/ChangeLog | 4 ++++ libgloss/or1k/timer.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 1dc57b6a5..77137f02b 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,7 @@ +2015-05-26 Stefan Wallentowitz + + * or1k/timer.c: Properly set interrupt flags + 2015-05-26 Stefan Wallentowitz * or1k/exception-asm.S: Store missing state diff --git a/libgloss/or1k/timer.c b/libgloss/or1k/timer.c index 27a24a1c1..08afa6034 100644 --- a/libgloss/or1k/timer.c +++ b/libgloss/or1k/timer.c @@ -35,7 +35,7 @@ _or1k_timer_interrupt_handler(void) uint32_t ttmr = or1k_mfspr(OR1K_SPR_TICK_TTMR_ADDR); ttmr = OR1K_SPR_TICK_TTMR_IE_SET(ttmr, 1); ttmr = OR1K_SPR_TICK_TTMR_MODE_SET(ttmr, OR1K_SPR_TICK_TTMR_MODE_RESTART); - ttmr = OR1K_SPR_TICK_TTMR_IE_SET(ttmr, 1); + ttmr = OR1K_SPR_TICK_TTMR_IP_SET(ttmr, 0); or1k_mtspr(OR1K_SPR_TICK_TTMR_ADDR, ttmr); } From 65ff3ce7fb20b63f93516890a06e8e6cec52fb99 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 26 May 2015 15:27:02 -0400 Subject: [PATCH 101/109] or1k: UART also accept timeout interrupt - The UART interrupt only handled receiver FIFO full interrupts, but we also want to handle timeout interrupts. * or1k/or1k_uart.c: Fix interrupts --- libgloss/ChangeLog | 4 ++++ libgloss/or1k/or1k_uart.c | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 77137f02b..6b3fe3c4e 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,7 @@ +2015-05-26 Stefan Wallentowitz + + * or1k/or1k_uart.c: Fix interrupts + 2015-05-26 Stefan Wallentowitz * or1k/timer.c: Properly set interrupt flags diff --git a/libgloss/or1k/or1k_uart.c b/libgloss/or1k/or1k_uart.c index e5b539af4..0a991e6ba 100644 --- a/libgloss/or1k/or1k_uart.c +++ b/libgloss/or1k/or1k_uart.c @@ -94,9 +94,11 @@ void _or1k_uart_interrupt_handler(uint32_t data) { uint8_t iir = REG8(IIR); - // Check if this is a read fifo interrupt, bit 0 indicates pending - // interrupt and the other bits are IIR_RDA - if (!(iir & 0x1) || ((iir & 0xfe) != IIR_RDA)) { + // Check if this is a read fifo or timeout interrupt, bit 0 + // indicates pending interrupt and the other bits are IIR_RDA + // or IIR_TO + if (!(iir & 0x1) || ((iir & 0xfe) != IIR_RDA) || + ((iir & 0xfe) != IIR_TO)) { return; } From c6d4802435a1705f48107b3ae275b8e941598828 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 26 May 2015 15:28:31 -0400 Subject: [PATCH 102/109] or1k: Make heap start configurable - Previously the heap started right after the bss section. This can now be configured by changing the _or1k_heap_start symbol that defaults to the old value (&end). In board_init_early, we can now set this to another value. * or1k/sbrk.c: Allow for different heap start --- libgloss/ChangeLog | 4 ++++ libgloss/or1k/sbrk.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 6b3fe3c4e..c05f12d06 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,7 @@ +2015-05-26 Stefan Wallentowitz + + * or1k/sbrk.c: Allow for different heap start + 2015-05-26 Stefan Wallentowitz * or1k/or1k_uart.c: Fix interrupts diff --git a/libgloss/or1k/sbrk.c b/libgloss/or1k/sbrk.c index de80663ee..5bd7044f7 100644 --- a/libgloss/or1k/sbrk.c +++ b/libgloss/or1k/sbrk.c @@ -19,12 +19,13 @@ #include "include/or1k-support.h" +extern uint32_t end; /* Set by linker. */ +uint32_t _or1k_heap_start = &end; static uint32_t _or1k_heap_end; void * _sbrk_r (struct _reent * reent, ptrdiff_t incr) { - extern uint32_t end; /* Set by linker. */ uint32_t prev_heap_end; // This needs to be atomic @@ -34,7 +35,7 @@ _sbrk_r (struct _reent * reent, ptrdiff_t incr) uint32_t sr_tee = or1k_timer_disable(); // Initialize heap end to end if not initialized before - or1k_sync_cas((void*) &_or1k_heap_end, 0, (uint32_t) &end); + or1k_sync_cas((void*) &_or1k_heap_end, 0, (uint32_t) _or1k_heap_start); do { // Read previous heap end From 569c0eb731bb62187175bf9ff0eafbce17fd578b Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 26 May 2015 15:30:30 -0400 Subject: [PATCH 103/109] or1k: set heap start for optimsoc-gzll - With the gzll kernel we have two different loading options: - If the image is loaded to the global memory, the bootstrapping loads the kernel to local memory. Applications are loaded on demand. The heap then starts right after bss. - If the image is pre-loaded to the local memory it includes the application binaries right after bss. The heap then starts after the application objects. - We can check if this is a gzll kernel as it has the string "gzll" at 0x2000. At 0x200c we then find the end of the application objects in the image. If there is no global memory we set _or1k_heap_start to this value. * or1k/boards/optimsoc.S: Heap for gzll kernel --- libgloss/ChangeLog | 4 ++++ libgloss/or1k/boards/optimsoc.S | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index c05f12d06..7605f3692 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,7 @@ +2015-05-26 Stefan Wallentowitz + + * or1k/boards/optimsoc.S: Heap for gzll kernel + 2015-05-26 Stefan Wallentowitz * or1k/sbrk.c: Allow for different heap start diff --git a/libgloss/or1k/boards/optimsoc.S b/libgloss/or1k/boards/optimsoc.S index a8493729d..eb782644d 100644 --- a/libgloss/or1k/boards/optimsoc.S +++ b/libgloss/or1k/boards/optimsoc.S @@ -22,7 +22,10 @@ #define OPTIMSOC_NA_REGS OPTIMSOC_NA_BASE + 0x00000 #define OPTIMSOC_NA_LMEM_SIZE OPTIMSOC_NA_REGS + 0x24 +#define OPTIMSOC_NA_GMEM_SIZE OPTIMSOC_NA_REGS + 0x1c +#define OPTIMSOC_GZLL_STRING 0x677a6c6c +#define OPTIMSOC_GZLL_IMAGE_LAYOUT 0x2000 /* * Define symbols to be used during startup - file is linked at compile time * @@ -49,6 +52,8 @@ _or1k_board_exit: .Lexitloop: OR1K_DELAYED_NOP(l.j .Lexitloop) +.extern _or1k_heap_start + .global _or1k_board_init_early _or1k_board_init_early: #ifndef __OR1K_MULTICORE__ @@ -62,6 +67,30 @@ _or1k_board_init_early: l.movhi r2,hi(_or1k_board_mem_size) l.ori r2,r2,lo(_or1k_board_mem_size) l.sw 0(r2),r1 + // Set stack beyond apps if single image in local memory + // Is this a kernel running? + l.movhi r3,hi(OPTIMSOC_GZLL_STRING) + l.ori r3,r3,lo(OPTIMSOC_GZLL_STRING) + l.movhi r4,hi(OPTIMSOC_GZLL_IMAGE_LAYOUT) + l.ori r4,r4,lo(OPTIMSOC_GZLL_IMAGE_LAYOUT) + l.lwz r5,0(r4) + l.sfeq r3,r5 + // If not, we are done + OR1K_DELAYED_NOP(l.bnf ._or1k_board_init_early_done) + // Else: are we running with global memory (loading)? + l.movhi r6,hi(OPTIMSOC_NA_GMEM_SIZE) + l.ori r6,r6,lo(OPTIMSOC_NA_GMEM_SIZE) + l.lwz r6,0(r6) + l.sfeqi r6,0 + // If yes, we are done + OR1K_DELAYED_NOP(l.bnf ._or1k_board_init_early_done) + // Else: Read end of apps + l.lwz r7,12(r4) + l.movhi r8,hi(_or1k_heap_start) + l.ori r8,r8,lo(_or1k_heap_start) + l.sw 0(r8),r7 +._or1k_board_init_early_done: + OR1K_DELAYED_NOP(l.jr r9) .weak _or1k_board_init _or1k_board_init: From d4aa267089e2479297517268baca23f3df7682f6 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 26 May 2015 15:32:19 -0400 Subject: [PATCH 104/109] or1k: Add missing initialization of impure ptr * or1k/impure.c: Fix initialization of impure ptr --- libgloss/ChangeLog | 4 ++++ libgloss/or1k/impure.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 7605f3692..3469fad33 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,7 @@ +2015-05-26 Stefan Wallentowitz + + * or1k/impure.c: Fix initialization of impure ptr + 2015-05-26 Stefan Wallentowitz * or1k/boards/optimsoc.S: Heap for gzll kernel diff --git a/libgloss/or1k/impure.c b/libgloss/or1k/impure.c index f4eb4ad19..e94fd637c 100644 --- a/libgloss/or1k/impure.c +++ b/libgloss/or1k/impure.c @@ -94,6 +94,9 @@ _or1k_libc_impure_init (void) _REENT_INIT_PTR (_impure_ptr); _REENT_INIT_PTR (_or1k_exception_impure_ptr); + // Use the standard impure ptr during normal software run + _or1k_impure_ptr = _impure_ptr; + // Set current to standard impure pointer _or1k_current_impure_ptr = _impure_ptr; #endif From ecfe018c65611dc3c7df4ca5b620322f1d25f2f3 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Tue, 26 May 2015 22:10:26 -0400 Subject: [PATCH 105/109] Avoid unneeded truncation to "int" * libm/math/e_sqrt.c (__ieee754_sqrt): Don't truncate constant to "int". --- newlib/ChangeLog | 5 +++++ newlib/libm/math/e_sqrt.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index d36decdd1..a70fefea9 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2015-05-26 DJ Delorie + + * libm/math/e_sqrt.c (__ieee754_sqrt): Don't truncate constant to + "int". + 2015-05-13 Nick Clifton * libm/common/s_signbit.c (__signbitf): Fix for 16-bit targets. diff --git a/newlib/libm/math/e_sqrt.c b/newlib/libm/math/e_sqrt.c index 460125a8f..78fc52417 100644 --- a/newlib/libm/math/e_sqrt.c +++ b/newlib/libm/math/e_sqrt.c @@ -99,7 +99,7 @@ static double one = 1.0, tiny=1.0e-300; #endif { double z; - __int32_t sign = (int)0x80000000; + __int32_t sign = 0x80000000; __uint32_t r,t1,s1,ix1,q1; __int32_t ix0,s0,q,m,t,i; From 3710583ebb9a677c267a7f02e1701d6dc54e8b12 Mon Sep 17 00:00:00 2001 From: David Stacey Date: Wed, 27 May 2015 12:08:29 +0200 Subject: [PATCH 106/109] Fix potential memory leak in argz_replace Signed-off-by: Corinna Vinschen --- newlib/ChangeLog | 4 ++++ newlib/libc/argz/argz_replace.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index a70fefea9..d1b0afec8 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2015-05-27 David Stacey + + * libc/argz/argz_replace.c: Fix potential memory leak. + 2015-05-26 DJ Delorie * libm/math/e_sqrt.c (__ieee754_sqrt): Don't truncate constant to diff --git a/newlib/libc/argz/argz_replace.c b/newlib/libc/argz/argz_replace.c index cb01eaef5..6bfd04b8a 100644 --- a/newlib/libc/argz/argz_replace.c +++ b/newlib/libc/argz/argz_replace.c @@ -71,7 +71,10 @@ _DEFUN (argz_replace, (argz, argz_len, str, with, replace_count), /* reallocate argz, and copy over the new value. */ if(!(*argz = (char *)realloc(*argz, new_argz_len))) - return ENOMEM; + { + free(new_argz); + return ENOMEM; + } memcpy(*argz, new_argz, new_argz_len); *argz_len = new_argz_len; From d337c37417a3358fa54afac0c1b395bf93f3f01f Mon Sep 17 00:00:00 2001 From: Takashi Yano Date: Wed, 27 May 2015 12:56:31 +0200 Subject: [PATCH 107/109] * net.cc: Define _NETIOAPI_H_ to accomodate newer w32api. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/net.cc | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3ecbc6b30..42f34d7bc 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2015-05-27 Takashi Yano + + * net.cc: Define _NETIOAPI_H_ to accomodate newer w32api. + 2015-05-03 Corinna Vinschen * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 2. diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index eaf6eb870..e94eb5004 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -18,7 +18,8 @@ details. */ if_indextoname functions in iphlpapi.h since Vista. TODO: Convert if_nametoindex to cygwin_if_nametoindex and call system functions on Vista and later. */ -#define _INC_NETIOAPI +#define _INC_NETIOAPI /* w32api < 4.0 */ +#define _NETIOAPI_H_ #include "winsup.h" #ifdef __x86_64__ /* 2014-04-24: Current Mingw headers define sockaddr_in6 using u_long (8 byte) From c978034e50fcbe559ace49b28c9cac1b28a663d6 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 28 May 2015 16:06:49 +0200 Subject: [PATCH 108/109] Use NtQueryObject to detect closing the last master handle Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/fhandler_tty.cc | 29 +++++++++++++++++++++-------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 42f34d7bc..c8d1470d9 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2015-05-28 Takashi Yano + Corinna Vinschen + + * fhandler_tty.cc (fhandler_pty_common::close): Don't close output_mutex + here. Move into callers. + (fhandler_pty_master::close): Use NtQueryObject instead of PeekNamedPipe + to detect closing the last master handle. + 2015-05-27 Takashi Yano * net.cc: Define _NETIOAPI_H_ to accomodate newer w32api. diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index e91b3e398..b74c39799 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -552,7 +552,10 @@ fhandler_pty_slave::close () get_output_handle_cyg ()); if ((unsigned) myself->ctty == FHDEV (DEV_PTYS_MAJOR, get_minor ())) fhandler_console::free_console (); /* assumes that we are the last pty closer */ - return fhandler_pty_common::close (); + fhandler_pty_common::close (); + if (!ForceCloseHandle (output_mutex)) + termios_printf ("CloseHandle (output_mutex<%p>), %E", output_mutex); + return 0; } int @@ -1259,8 +1262,6 @@ fhandler_pty_common::close () termios_printf ("pty%d <%p,%p> closing", get_minor (), get_handle (), get_output_handle ()); if (!ForceCloseHandle (input_mutex)) termios_printf ("CloseHandle (input_mutex<%p>), %E", input_mutex); - if (!ForceCloseHandle (output_mutex)) - termios_printf ("CloseHandle (output_mutex<%p>), %E", output_mutex); if (!ForceCloseHandle1 (get_handle (), from_pty)) termios_printf ("CloseHandle (get_handle ()<%p>), %E", get_handle ()); if (!ForceCloseHandle1 (get_output_handle (), to_pty)) @@ -1281,6 +1282,9 @@ fhandler_pty_master::cleanup () int fhandler_pty_master::close () { + OBJECT_BASIC_INFORMATION obi; + NTSTATUS status; + termios_printf ("closing from_master(%p)/to_master(%p)/to_master_cyg(%p) since we own them(%u)", from_master, to_master, to_master_cyg, dwProcessId); if (cygwin_finished_initializing) @@ -1309,13 +1313,22 @@ fhandler_pty_master::close () } } - fhandler_pty_common::close (); - /* Check if the last master handle has been closed. If so, set input_available_event to wake up potentially waiting slaves. */ - if (!PeekNamedPipe (from_master, NULL, 0, NULL, NULL, NULL) - && GetLastError () == ERROR_BROKEN_PIPE) - SetEvent (input_available_event); + acquire_output_mutex (INFINITE); + status = NtQueryObject (get_output_handle (), ObjectBasicInformation, + &obi, sizeof obi, NULL); + fhandler_pty_common::close (); + release_output_mutex (); + if (!ForceCloseHandle (output_mutex)) + termios_printf ("CloseHandle (output_mutex<%p>), %E", output_mutex); + if (!NT_SUCCESS (status)) + debug_printf ("NtQueryObject: %y", status); + else if (obi.HandleCount == 1) + { + termios_printf("Closing last master of pty%d", get_minor ()); + SetEvent (input_available_event); + } if (!ForceCloseHandle (from_master)) termios_printf ("error closing from_master %p, %E", from_master); From 714507ff38837630bb6456c35fd7f4bd6ba5680a Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 28 May 2015 16:39:09 +0200 Subject: [PATCH 109/109] Fix comment in sys/wait.h Signed-off-by: Corinna Vinschen --- newlib/ChangeLog | 4 ++++ newlib/libc/include/sys/wait.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index d1b0afec8..632f2acb5 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2015-05-28 Corinna Vinschen + + * libc/include/sys/wait.h: Fix comment. + 2015-05-27 David Stacey * libc/argz/argz_replace.c: Fix potential memory leak. diff --git a/newlib/libc/include/sys/wait.h b/newlib/libc/include/sys/wait.h index 73fe37202..f17e53f12 100644 --- a/newlib/libc/include/sys/wait.h +++ b/newlib/libc/include/sys/wait.h @@ -11,7 +11,7 @@ extern "C" { #define WUNTRACED 2 /* A status looks like: - <2 bytes info> <2 bytes code> + <1 byte info> <1 byte code> == 0, child has exited, info is the exit value == 1..7e, child has exited, info is the signal number.