for symbol in __GI___pthread_disable_asynccancel __GI___pthread_enable_asynccancel __pthread_disable_asynccancel __pthread_enable_asynccancel calloc free malloc realloc __stack_chk_fail __stack_chk_fail_local; do \
echo ".globl $symbol"; \
echo "$symbol:"; \
done | gcc -o /home/sitianos/Project/Drive/build/elf/librtld.mapT.o -g -Werror=undef -Wa,--noexecstack -c -x assembler -
gcc -nostdlib -nostartfiles -r -o /home/sitianos/Project/Drive/build/elf/librtld.map.o /home/sitianos/Project/Drive/build/elf/librtld.mapT.o '-Wl,-(' /home/sitianos/Project/Drive/build/elf/dl-allobjs.os /home/sitianos/Project/Drive/build/libc_pic.a -lgcc '-Wl,-)' -Wl,-Map,/home/sitianos/Project/Drive/build/elf/librtld.mapT
/usr/bin/ld: /home/sitianos/Project/Drive/build/libc_pic.a(getcwd.os): in function `__GI___getcwd':
/home/sitianos/Project/Drive/glibc-drive/io/../sysdeps/unix/sysv/linux/getcwd.c:49: multiple definition of `__getcwd'; /home/sitianos/Project/Drive/build/elf/dl-allobjs.os:/home/sitianos/Project/Drive/glibc-drive/elf/../sysdeps/unix/sysv/linux/getcwd.c:49: first defined here
/usr/bin/ld: /home/sitianos/Project/Drive/build/libc_pic.a(dl-error.os): in function `__GI__dl_signal_exception':
/home/sitianos/Project/Drive/glibc-drive/elf/dl-error-skeleton.c:91: multiple definition of `_dl_signal_exception'; /home/sitianos/Project/Drive/build/elf/dl-allobjs.os:/home/sitianos/Project/Drive/glibc-drive/elf/dl-error-skeleton.c:91: first defined here
/usr/bin/ld: /home/sitianos/Project/Drive/build/libc_pic.a(dl-error.os): in function `__GI__dl_signal_error':
/home/sitianos/Project/Drive/glibc-drive/elf/dl-error-skeleton.c:109: multiple definition of `_dl_signal_error'; /home/sitianos/Project/Drive/build/elf/dl-allobjs.os:/home/sitianos/Project/Drive/glibc-drive/elf/dl-error-skeleton.c:109: first defined here
/usr/bin/ld: /home/sitianos/Project/Drive/build/libc_pic.a(dl-error.os): in function `__GI__dl_catch_exception':
/home/sitianos/Project/Drive/glibc-drive/elf/dl-error-skeleton.c:175: multiple definition of `_dl_catch_exception'; /home/sitianos/Project/Drive/build/elf/dl-allobjs.os:/home/sitianos/Project/Drive/glibc-drive/elf/dl-error-skeleton.c:175: first defined here
/usr/bin/ld: /home/sitianos/Project/Drive/build/libc_pic.a(dl-error.os): in function `__GI__dl_catch_error':
/home/sitianos/Project/Drive/glibc-drive/elf/dl-error-skeleton.c:225: multiple definition of `_dl_catch_error'; /home/sitianos/Project/Drive/build/elf/dl-allobjs.os:/home/sitianos/Project/Drive/glibc-drive/elf/dl-error-skeleton.c:225: first defined here
collect2: error: ld returned 1 exit status
$ /usr/lib/x86_64-linux-gnu/libc.so.6
GNU C Library (Debian GLIBC 2.35-3) stable release version 2.35.
Copyright (C)2022 Free Software Foundation, Inc.
This is free software; see the sourcefor copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 11.3.0.
libc ABIs: UNIQUE IFUNC ABSOLUTE
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.
$ sommelier-register "http://localhost:8000/api""region""/alice"
successfully registered. user id is 1
configuration is saved in drive_envs
$ cat drive_envs
# key to encrypt data
print_data_sk (){
cat << END_OF_FILE-----BEGIN PRIVATE KEY-----MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDEvumJhkNvwPzx1bB52SLrP6wS+DL+l+umOJ0rIsuuwWcbRS7cRejWwN7GYC0og6r0or~~~~~~~~~~~~~~~~~~~~~~~~j5WFyup4lgD0uwH9TLXsZj5s13fYs6HhyOBhJyDMbNvkz46Bi0U2kDQvAmiSAmCyixu5XBCophbUe+H8uevbNQ==-----END PRIVATE KEY-----END_OF_FILE}# key to use for searchable encryption
print_keyword_sk (){
cat << END_OF_FILE{"alphas":[[8781683650687187445,1371472541923046913,15906317983419354644,7861644468431804003],~~~~~~~~~~~~~~~~~~~~,169,67,239,123,187,54,92,20,230,126,253,242,134,179,34,38,135,162,88,13,158,42,195,234,189,122,158,196,206]}END_OF_FILE}# client user idexportSOMMELIER_DRIVE_USER_ID=1# server to connect toexportSOMMELIER_DRIVE_BASE_URL=http://localhost:8000/api
# server regionexportSOMMELIER_DRIVE_REGION_NAME=region
# remote home directoryexportSOMMELIER_DRIVE_HOME_DIR=/alice
#!/bin/sh# directory on which files on the remote drive are putexportSOMMELIER_DRIVE_BASE_DIR=/tmp/drive
rm -rf $SOMMELIER_DRIVE_BASE_DIR
mkdir -p $SOMMELIER_DRIVE_BASE_DIR
chmod 700$SOMMELIER_DRIVE_BASE_DIR# whether to trace library callsexportSOMMELIER_DRIVE_TRACE=0# load server info and user info
. $PWD/drive_envs
SOMMELIER_DRIVE_DATA_SK=$(mktemp -p $SOMMELIER_DRIVE_BASE_DIR)
print_data_sk > $SOMMELIER_DRIVE_DATA_SKexport SOMMELIER_DRIVE_DATA_SK
SOMMELIER_DRIVE_KEYWORD_SK=$(mktemp -p $SOMMELIER_DRIVE_BASE_DIR)
print_keyword_sk > $SOMMELIER_DRIVE_KEYWORD_SKexport SOMMELIER_DRIVE_KEYWORD_SK
# library path of Sommelier Drive APIexportSOMMELIER_DRIVE_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/libsommelier_drive_client.so
# library to preload for function hookingexportLD_PRELOAD=/usr/lib/x86_64-linux-gnu/libsommelier_libc.so
# execute privided commandexec$@
$ echo"this is a local file" > localfile
$ sommelier-run cp localfile sommelier:/alice/file2
$ sommelier-run cat sommelier:/alice/file2
this is a local file
$ sommelier-run cp sommelier:/alice/file2 sommelier:/alice/file3
$ sommelier-run cat sommelier:/alice/file3
this is a local file
$ sommelier-run cp sommelier:/alice/file2 remotefile
$ cat remotefile
this is a local file
次にlsコマンドによりリモートに作成したファイルとディレクトリを確認する。
123456
$ sommelier-run ls -l sommelier:/alice/
total 0
drw------- 0 alice alice 0 Jan 11970 dir1
-rw------- 0 alice alice 0 Jan 11970 file1
-rw------- 0 alice alice 21 Jan 11970 file2
-rw------- 0 alice alice 21 Jan 11970 file3