Skip to content

Commit

Permalink
random: export __trivfs_server_name
Browse files Browse the repository at this point in the history
Making glibc access trivfs_server_name would violate namespace
constraints, so we need to use a out-of-standard name.
  • Loading branch information
sthibaul committed Jan 1, 2022
1 parent edf389d commit 8c5eb65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions trans/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ symlink: fsysServer.o
fakeroot: ../libnetfs/libnetfs.a
fifo new-fifo: ../libpipe/libpipe.a
crash fifo firmlink hello hello-mt ifsock magic mtab new-fifo null password proxy-defpager remap streamio: ../libtrivfs/libtrivfs.a
random-LDFLAGS = -Wl,--export-dynamic-symbol=__trivfs_server_name
$(targets): ../libfshelp/libfshelp.a \
../libihash/libihash.a \
../libiohelp/libiohelp.a \
Expand Down
3 changes: 3 additions & 0 deletions trans/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@

char *trivfs_server_name = "random";

/* Referred by glibc to avoid using /dev/random for malloc() initialization */
char *__trivfs_server_name = "random";

/* Entropy pool. We use one of the SHAKE algorithms from the Keccak
family. Being a sponge construction, it allows the extraction of
arbitrary amounts of pseudorandom data. */
Expand Down

0 comments on commit 8c5eb65

Please sign in to comment.