403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.168
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/security/opencryptoki/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/security/opencryptoki/files/patch-usr-sbin-pkcsslotd-slotmgr.c
--- usr/sbin/pkcsslotd/slotmgr.c.orig	2022-04-25 11:04:51 UTC
+++ usr/sbin/pkcsslotd/slotmgr.c
@@ -137,9 +137,9 @@ void run_sanity_checks()
     }
 
     /* check that the pkcs11 group exists */
-    grp = getgrnam("pkcs11");
+    grp = getgrnam(PKCS11GROUP);
     if (!grp) {
-        fprintf(stderr, "There is no 'pkcs11' group on this system.\n");
+        fprintf(stderr, "There is no '" PKCS11GROUP "' group on this system.\n");
         exit(1);
     }
 
@@ -162,6 +162,15 @@ void run_sanity_checks()
                 fprintf(stderr, "Directory %s missing\n", dircheck[i].dir);
                 exit(2);
             }
+	}
+        ec = stat(dircheck[i].dir, &sbuf);
+	if (ec != 0) {
+                fprintf(stderr, "Directory %s missing\n", dircheck[i].dir);
+                exit(2);
+	}
+	if (sbuf.st_mode != dircheck[i].mode ||
+	    sbuf.st_uid != geteuid() ||
+	    sbuf.st_gid != grp->gr_gid) {
             /* set ownership to root, and pkcs11 group */
             if (chown(dircheck[i].dir, geteuid(), grp->gr_gid) != 0) {
                 fprintf(stderr,
@@ -230,9 +239,9 @@ int chk_create_tokdir(Slot_Info_t_64 *psinfo)
 
     /* get 'PKCS11' group id */
     uid = (int) geteuid();
-    grp = getgrnam("pkcs11");
+    grp = getgrnam(PKCS11GROUP);
     if (!grp) {
-        fprintf(stderr, "PKCS11 group does not exist [errno=%d].\n", errno);
+        fprintf(stderr, PKCS11GROUP " group does not exist [errno=%d].\n", errno);
         return errno;
     } else {
         grpid = grp->gr_gid;
@@ -719,7 +728,12 @@ int main(int argc, char *argv[], char *envp[])
      */
     if (Daemon) {
         pid_t pid;
+#if !defined(__FreeBSD__)
         if ((pid = fork()) < 0) {
+#else
+	/* epoll emulation with kqueue requires sharing the fd table */
+        if ((pid = rfork(RFPROC)) < 0) {
+#endif
             term_socket_server();
             DestroyMutexes();
             DetachFromSharedMemory();

Youez - 2016 - github.com/yon3zu
LinuXploit