glibc: added overlayed port

This commit is contained in:
Victor Martinez 2016-06-02 09:47:18 +02:00
parent dc0ba31695
commit e16650c160
11 changed files with 2557 additions and 0 deletions

2237
glibc/.footprint Normal file

File diff suppressed because it is too large Load Diff

7
glibc/.md5sum Normal file
View File

@ -0,0 +1,7 @@
e51e02bf552a0a1fbbdc948fb2f5e83c glibc-2.22.tar.xz
96156bec8e05de67384dc93e72bdc313 host.conf
fbbc215a9b15ba4846f326cc88108057 hosts
f7fefce570a3c776e26e778c5e401490 ld.so.conf
af9dd5d8f71185a64a8eccface15fc00 linux-4.1.13.tar.xz
75931315bf9bc9be15a5e25e4ddd5f0d nsswitch.conf
acf9daad1ee85de5efd3543965596a63 resolv.conf

2
glibc/.nostrip Normal file
View File

@ -0,0 +1,2 @@
^lib/ld-.*\.so$
^lib/libpthread-.*\.so$

51
glibc/Pkgfile Normal file
View File

@ -0,0 +1,51 @@
# Description: The C library used in the GNU system
# URL: http://www.gnu.org/software/libc/
# Maintainer: CRUX System Team, core-ports at crux dot nu
# Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu
# Depends on:
name=glibc
version=2.22
release=1
source=(http://ftp.gnu.org/gnu/glibc/glibc-$version.tar.xz \
http://ftp.kernel.org/pub/linux/kernel/v4.x/linux-4.1.13.tar.xz \
hosts resolv.conf nsswitch.conf host.conf ld.so.conf)
build() {
# install kernel headers
cd linux-4.1.13
make mrproper
make ARCH=arm64 headers_check
make ARCH=arm64 INSTALL_HDR_PATH=$PKG/usr headers_install
mkdir $SRC/build
cd $SRC/build
../$name-$version/configure --prefix=/usr \
--build=aarch64-unknown-linux-gnueabi \
--libexecdir=/usr/lib \
--with-headers=$PKG/usr/include \
--enable-kernel=2.6.25 \
--enable-add-ons \
--enable-static-nss \
--disable-profile \
--disable-werror \
--without-gd \
--enable-obsolete-rpc
make
make install_root=$PKG install
install -m 0644 $SRC/$name-$version/nscd/nscd.conf $PKG/etc
install -d $PKG/var/{db,run}/nscd
install -m 0644 $SRC/{hosts,resolv.conf,nsswitch.conf,host.conf,ld.so.conf} $PKG/etc
ln -sf ../usr/share/zoneinfo/UTC $PKG/etc/localtime
ln -s stubs-hard.h $PKG/usr/include/gnu/stubs-soft.h
install -d $PKG/etc/ld.so.conf.d $PKG/usr/lib/locale
touch $PKG/etc/ld.so.cache
rm -rf $PKG/usr/share/{info,locale} \
$PKG/usr/bin/tzselect \
$PKG/usr/sbin/z{dump,ic}
}

8
glibc/host.conf Normal file
View File

@ -0,0 +1,8 @@
#
# /etc/host.conf: resolver configuration file
#
order hosts,bind
multi on
# End of file

17
glibc/hosts Normal file
View File

@ -0,0 +1,17 @@
#
# /etc/hosts: static lookup table for host names
#
# IPv4
127.0.0.1 localhost
#<ip-address> <hostname.domain.org> <aliases>
# IPv6
#::1 ip6-localhost ip6-loopback
#fe00::0 ip6-localnet
#ff00::0 ip6-mcastprefix
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
#ff02::3 ip6-allhosts
# End of file

View File

@ -0,0 +1,192 @@
X-Git-Url: https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=blobdiff_plain;f=iconv%2Fgconv_trans.c;h=e0835fc66684e63964b1376a0c730a70225f63f4;hp=1e25854ccfa84e4f612320f61e6cafa2f955a7d9;hb=a1a6a401ab0a3c9f15fb7eaebbdcee24192254e8;hpb=e4e7cfd287686d26fce2218ed5b2d383db5e338a
diff --git a/iconv/gconv_trans.c b/iconv/gconv_trans.c
index 1e25854..e0835fc 100644
--- a/iconv/gconv_trans.c
+++ b/iconv/gconv_trans.c
@@ -238,181 +238,12 @@ __gconv_transliterate (struct __gconv_step *step,
return __GCONV_ILLEGAL_INPUT;
}
-
-/* Structure to represent results of found (or not) transliteration
- modules. */
-struct known_trans
-{
- /* This structure must remain the first member. */
- struct trans_struct info;
-
- char *fname;
- void *handle;
- int open_count;
-};
-
-
-/* Tree with results of previous calls to __gconv_translit_find. */
-static void *search_tree;
-
-/* We modify global data. */
-__libc_lock_define_initialized (static, lock);
-
-
-/* Compare two transliteration entries. */
-static int
-trans_compare (const void *p1, const void *p2)
-{
- const struct known_trans *s1 = (const struct known_trans *) p1;
- const struct known_trans *s2 = (const struct known_trans *) p2;
-
- return strcmp (s1->info.name, s2->info.name);
-}
-
-
-/* Open (maybe reopen) the module named in the struct. Get the function
- and data structure pointers we need. */
-static int
-open_translit (struct known_trans *trans)
-{
- __gconv_trans_query_fct queryfct;
-
- trans->handle = __libc_dlopen (trans->fname);
- if (trans->handle == NULL)
- /* Not available. */
- return 1;
-
- /* Find the required symbol. */
- queryfct = __libc_dlsym (trans->handle, "gconv_trans_context");
- if (queryfct == NULL)
- {
- /* We cannot live with that. */
- close_and_out:
- __libc_dlclose (trans->handle);
- trans->handle = NULL;
- return 1;
- }
-
- /* Get the context. */
- if (queryfct (trans->info.name, &trans->info.csnames, &trans->info.ncsnames)
- != 0)
- goto close_and_out;
-
- /* Of course we also have to have the actual function. */
- trans->info.trans_fct = __libc_dlsym (trans->handle, "gconv_trans");
- if (trans->info.trans_fct == NULL)
- goto close_and_out;
-
- /* Now the optional functions. */
- trans->info.trans_init_fct =
- __libc_dlsym (trans->handle, "gconv_trans_init");
- trans->info.trans_context_fct =
- __libc_dlsym (trans->handle, "gconv_trans_context");
- trans->info.trans_end_fct =
- __libc_dlsym (trans->handle, "gconv_trans_end");
-
- trans->open_count = 1;
-
- return 0;
-}
-
-
int
internal_function
__gconv_translit_find (struct trans_struct *trans)
{
- struct known_trans **found;
- const struct path_elem *runp;
- int res = 1;
-
- /* We have to have a name. */
- assert (trans->name != NULL);
-
- /* Acquire the lock. */
- __libc_lock_lock (lock);
-
- /* See whether we know this module already. */
- found = __tfind (trans, &search_tree, trans_compare);
- if (found != NULL)
- {
- /* Is this module available? */
- if ((*found)->handle != NULL)
- {
- /* Maybe we have to reopen the file. */
- if ((*found)->handle != (void *) -1)
- /* The object is not unloaded. */
- res = 0;
- else if (open_translit (*found) == 0)
- {
- /* Copy the data. */
- *trans = (*found)->info;
- (*found)->open_count++;
- res = 0;
- }
- }
- }
- else
- {
- size_t name_len = strlen (trans->name) + 1;
- int need_so = 0;
- struct known_trans *newp;
-
- /* We have to continue looking for the module. */
- if (__gconv_path_elem == NULL)
- __gconv_get_path ();
-
- /* See whether we have to append .so. */
- if (name_len <= 4 || memcmp (&trans->name[name_len - 4], ".so", 3) != 0)
- need_so = 1;
-
- /* Create a new entry. */
- newp = (struct known_trans *) malloc (sizeof (struct known_trans)
- + (__gconv_max_path_elem_len
- + name_len + 3)
- + name_len);
- if (newp != NULL)
- {
- char *cp;
-
- /* Clear the struct. */
- memset (newp, '\0', sizeof (struct known_trans));
-
- /* Store a copy of the module name. */
- newp->info.name = cp = (char *) (newp + 1);
- cp = __mempcpy (cp, trans->name, name_len);
-
- newp->fname = cp;
-
- /* Search in all the directories. */
- for (runp = __gconv_path_elem; runp->name != NULL; ++runp)
- {
- cp = __mempcpy (__stpcpy ((char *) newp->fname, runp->name),
- trans->name, name_len);
- if (need_so)
- memcpy (cp, ".so", sizeof (".so"));
-
- if (open_translit (newp) == 0)
- {
- /* We found a module. */
- res = 0;
- break;
- }
- }
-
- if (res)
- newp->fname = NULL;
-
- /* In any case we'll add the entry to our search tree. */
- if (__tsearch (newp, &search_tree, trans_compare) == NULL)
- {
- /* Yickes, this should not happen. Unload the object. */
- res = 1;
- /* XXX unload here. */
- }
- }
- }
-
- __libc_lock_unlock (lock);
-
- return res;
+ /* Transliteration module loading has been removed because it never
+ worked as intended and suffered from a security vulnerability.
+ Consequently, this function always fails. */
+ return 1;
}

7
glibc/ld.so.conf Normal file
View File

@ -0,0 +1,7 @@
#
# /etc/ld.so.conf: dynamic linker configuration file
#
include /etc/ld.so.conf.d/*.conf
# End of file

24
glibc/nsswitch.conf Normal file
View File

@ -0,0 +1,24 @@
#
# /etc/nsswitch.conf: name service switch configuration file
#
passwd: files
group: files
shadow: files
hosts: files dns
networks: files
services: files
protocols: files
rpc: files
publickey: files
ethers: files
netmasks: files
netgroup: files
bootparams: files
automount: files
aliases: files
# End of file

4
glibc/post-install Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
/sbin/telinit U

8
glibc/resolv.conf Normal file
View File

@ -0,0 +1,8 @@
#
# /etc/resolv.conf: resolver configuration file
#
#search <domain.org>
#nameserver <ip-address>
# End of file