Processes whose top level is a language other than M report a GTMSECSHRPERM
Final Release Note
Processes whose top level is a language other than M report a GTMSECSHRPERM error if $ydb_dist/gtmsecshr
is not owned by root or does not have the setuid bit set. Previously, such calls terminated the process abnormally with a SIG-11. [#467 (closed)]
Description
$ cat simpleapi.c
#include "libyottadb.h"
#include <stdio.h>
#define ERRBUF_SIZE 1024
char errbuf[ERRBUF_SIZE];
int main()
{
int status;
status = ydb_init();
if (YDB_OK != status)
{
ydb_zstatus(errbuf, ERRBUF_SIZE);
printf("ydb_init() : status = %d : %s\n", status, errbuf);
}
return status;
}
$ cat simpleapi.sh
cc -c -fPIC -I$ydb_dist simpleapi.c
cc -o simpleapi simpleapi.o -Wl,-rpath,$ydb_dist -L$ydb_dist -lyottadb
./simpleapi
When gtmsecshr has setuid (s
) bit set, the test works fine.
> ls -l $ydb_dist/gtmsecshr
-r-sr-sr-x 2 root root 24680 Jun 17 17:40 gtmsecshr*
$ . ./simpleapi.sh
$
But when gtmsecshr does not have setuid bit set, the test dumps core
> sudo chmod a-s $ydb_dist/gtmsecshr
> ls -l $ydb_dist/gtmsecshr
-r-xr-xr-x 2 root root 24680 Jun 17 17:40 gtmsecshr*
$ . ./simpleapi.sh
Segmentation fault (core dumped)
The same issue exists if gtmsecshr is not owned by the root userid.
Draft Release Note
SimpleAPI/SimpleThreadAPI calls (e.g. ydb_set_s()
or ydb_set_st()
) return a value equal to -YDB_ERR_GTMSECSHRPERM
in case $ydb_dist/gtmsecshr is not root owned and/or does not have the setuid bit (s
bit in ls -l output) set. Previously, such calls used to terminate the process abnormally with a SIG-11.