-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: urcd
action: commit
revision:
path_from:
revision_from: c3ab2b4172b3ed376940f69e3432b573a45ea498:
path_to:
revision_to:

git.thebackupbox.net

urcd

git://git.thebackupbox.net/urcd

commit c3ab2b4172b3ed376940f69e3432b573a45ea498
Author: root <root@localhost.(none)>
Date:   Tue Jul 22 07:54:11 2014 +0000

    [CryptoServ] allow disabling EXPIRY by setting env/EXPIRY to 0

diff --git a/README b/README

index 48e14b638ed6945d2b4c336fedd733374fff9547..

index ..3655d87994aa7e8372767a40fa9405e5bdc0497c 100644

--- a/README
+++ b/README
@@ -367,8 +367,9 @@ POLICY and ISUPPORT:
     can write to the network.

   EXPIRY:
-    integer argument with a default of 32 days. This is how long a CryptoServ
-    account has until it is deleted from inactivity.
+    integer argument with a default of 32 days. this is how long a CryptoServ
+    account has until it is deleted from inactivity. setting this value to 0
+    will disable account expirations.

   COLOUR:
     integer default is 0. changing this value to 1 will allow colour encoding
diff --git a/src/cryptoserv.c b/src/cryptoserv.c

index e183ee5711aeabfb1d8fba1d1d337b9de194d099..

index ..d90e94f8944faea8178ccb6b5cc0d17fc3fc79a1 100644

--- a/src/cryptoserv.c
+++ b/src/cryptoserv.c
@@ -146,27 +146,29 @@ main(int argc, char *argv[])

  memcpy(buffer2+2+12+4+8,":CryptoServ!urc@service PRIVMSG ",32);

- memcpy(path,"urcsigndb/",10);
- if (!(directory=opendir("urcsigndb/"))) exit(4);
- while ((file=readdir(directory)))
- {
-   if (file->d_name[0] == '.') continue;
-   bzero(path+10,-10+512);
-   memcpy(path+10,file->d_name,strlen(file->d_name));
-   stat(path,(struct stat *)&stats);
-   if (time((long *)0) - stats.st_atime >= EXPIRY) remove(path);
- } closedir(directory);
-
- memcpy(path,"urccryptoboxdir/",16);
- if (!(directory=opendir("urccryptoboxdir/"))) exit(5);
- while ((file=readdir(directory)))
- {
-   if (file->d_name[0] == '.') continue;
-   bzero(path+16,-16+512);
-   memcpy(path+16,file->d_name,strlen(file->d_name));
-   stat(path,(struct stat *)&stats);
-   if (time((long *)0) - stats.st_atime >= EXPIRY) remove(path);
- } closedir(directory);
+ if (EXPIRY) {
+  memcpy(path,"urcsigndb/",10);
+  if (!(directory=opendir("urcsigndb/"))) exit(4);
+  while ((file=readdir(directory)))
+  {
+    if (file->d_name[0] == '.') continue;
+    bzero(path+10,-10+512);
+    memcpy(path+10,file->d_name,strlen(file->d_name));
+    stat(path,(struct stat *)&stats);
+    if (time((long *)0) - stats.st_atime >= EXPIRY) remove(path);
+  } closedir(directory);
+
+  memcpy(path,"urccryptoboxdir/",16);
+  if (!(directory=opendir("urccryptoboxdir/"))) exit(5);
+  while ((file=readdir(directory)))
+  {
+    if (file->d_name[0] == '.') continue;
+    bzero(path+16,-16+512);
+    memcpy(path+16,file->d_name,strlen(file->d_name));
+    stat(path,(struct stat *)&stats);
+    if (time((long *)0) - stats.st_atime >= EXPIRY) remove(path);
+  } closedir(directory);
+ }

  while (1)
  {

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 14:36:03 2024