opencryptoki/opencryptoki-2.4-group.patch
2015-08-27 17:33:43 +02:00

42 lines
1.1 KiB
Diff

diff -up opencryptoki/usr/lib/pkcs11/api/shrd_mem.c.in.group opencryptoki/usr/lib/pkcs11/api/shrd_mem.c.in
--- opencryptoki/usr/lib/pkcs11/api/shrd_mem.c.in.group 2015-08-27 11:35:42.759397175 +0200
+++ opencryptoki/usr/lib/pkcs11/api/shrd_mem.c.in 2015-08-27 11:39:02.240023425 +0200
@@ -352,37 +352,6 @@ attach_shared_memory() {
return NULL;
}
- uid = getuid();
- euid = geteuid();
- // only check group membership if not root user
- if (uid != 0 && euid != 0) {
- int i, member=0;
- grp = getgrnam("pkcs11");
- if (!grp) {
- // group pkcs11 not known to the system
- return NULL;
- }
- pw = getpwuid(uid);
- epw = getpwuid(euid);
- for (i=0; grp->gr_mem[i]; i++) {
- if (pw) {
- if (!strncmp(pw->pw_name, grp->gr_mem[i],strlen(pw->pw_name))) {
- member = 1;
- break;
- }
- }
- if (epw) {
- if (!strncmp(epw->pw_name, grp->gr_mem[i],strlen(epw->pw_name))) {
- member = 1;
- break;
- }
- }
- }
- if (!member) {
- return NULL;
- }
- }
-
Anchor->shm_tok = ftok(TOK_PATH,'b');
// Get the shared memory id.