🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #21069

New PGP signing patch for slrn 0.8.8

#21069
From: Felix von Leitner
Date: Mon, 29 Apr 1996 00:00
102 lines
3478 bytes
-----BEGIN PGP SIGNED MESSAGE-----

Again, get and unpack slrn and run "patch slrn/src/post.c < slrn.diff"
where slrn.diff is the rest of this file.  The tempfile is now properly
deleted.

Felix

- --- save from here as slrn.diff ---
281a282
> 
413a415,416
> static char passphrase[1024];
> 
430c433
< 	rsp = slrn_get_response ("yYnNeE", "Post the message? Y-es, N-o, E-dit");
- ---
> 	rsp = slrn_get_response ("yYnNeEsSpP", "Post the message? Y-es, N-o, E-dit, S-pell check, P-GP sign");
434c437,502
< 	if (slrn_edit_file (file, 1) < 0) 
- ---
> 	if (rsp == 's') {
> 	  char cmd[1024] = "ispell -x ";
> 	  strcat( cmd, file );
> 	  slrn_posix_system( cmd, 1 );
> 	}
> 	if (rsp == 'p') {
> 	  char cmd[1024] = "pgp -als +batchmode ";
> 	  char tmpfile[256];
> 	  FILE *infp,*outfp,*pp;
> 	  if (passphrase[0]==0) {
> 	    if (slrn_read_input("Passphrase: ",passphrase,0) <= 0) continue;
> 	  }
> 	  if (NULL == (infp = fopen (file, "r+")))
> 	    {
> 	      slrn_error ("File not found: %s--- message not signed.", file);
> 	      return -1;
> 	    }
> 	  outfp=slrn_open_tmpfile(tmpfile,"w");
> 	  for(;;) {
> 	    char line[1024];
> 	    if (fgets(line,1024,infp)==NULL) {
> 	      slrn_error ("No body--- message not signed.");
> 	      return -1;
> 	    }
> 	    if (line[0]=='\n') break;
> 	  }
> 	  for(;;) {
> 	    char line[1024];
> 	    if (fgets(line,1024,infp)==NULL) break;
> 	    fputs(line,outfp);
> 	  }
> 	  rewind(infp);
> 	  fclose(outfp);
> 	  strcat(cmd,tmpfile);
> 	  putenv("PGPPASSFD=0");
> 	  if ((pp=slrn_popen(cmd,"w"))==NULL) {
> 	    fclose(pp);
> 	    return -1;
> 	  }
> 	  fputs(passphrase,pp);
>    	  slrn_pclose (pp);
> 	  for(;;) {
> 	    char line[1024];
> 	    if (fgets(line,1024,infp)==NULL) {
> 	      slrn_error ("No body--- message not signed.");
> 	      return -1;
> 	    }
> 	    if (line[0]=='\n') break;
> 	  }
> 	  fseek(infp,0,1);
> 	  unlink(tmpfile);
> 	  strcat(tmpfile,".asc");
> 	  if ((outfp=fopen(tmpfile,"r"))==NULL) {
> 	    slrn_error ("Cannot open file:%s--- message not signed.",tmpfile);
> 	    return -1;
> 	  }
> 	  for(;;) {
> 	    char line[1024];
> 	    if (fgets(line,1020,outfp)==NULL) break;
> 	    fputs(line,infp);
> 	  }
> 	  fclose(outfp);
> 	  fclose(infp);
> 	  unlink(tmpfile);
> 	}
> 	if (rsp=='e') if (slrn_edit_file (file, 1) < 0) 

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQCVAwUBMYTqSx/Da1Yoy+f1AQHOjwP9FOkwO4p7IO3hhibTbW96/TjZl/jR/9vM
KPQHOpRg0n2uj59Bkl+/lu5oyqOxh4+J+hzVno0tcryUlPBXTt7KMpLSXmNFJmZD
TnlES5hGH7l618En1z9cK0NWotxNWah6xBtp/S/AMSAVZX7Jvk6bV9nPKsmueyJg
6zqckBsGPzs=
=Ikz2
-----END PGP SIGNATURE-----


Technical Details
Message-ID: <slrn4o9qil.4po.leitner@stott.math.fu-berlin.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <slrn4o632j.hiv.leitner@landau.math.fu-berlin.de> <slrn4o79hp.2p.gjohnson@dream.season.com> <slrn4o91c5.v4.leitner@cauchy.math.fu-berlin.de>

Show Full Headers
Complete Article Headers
Message-ID: <slrn4o9qil.4po.leitner@stott.math.fu-berlin.de>
Subject: New PGP signing patch for slrn 0.8.8
Date: Mon, 29 Apr 1996 00:00:00 +0000
From: leitner@stott.math.fu-berlin.de (Felix von Leitner)
References: <slrn4o632j.hiv.leitner@landau.math.fu-berlin.de> <slrn4o79hp.2p.gjohnson@dream.season.com> <slrn4o91c5.v4.leitner@cauchy.math.fu-berlin.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 152063096
Organization: Freie Universitaet Berlin
X-access: 16 17 19
Reply-to: leitner@prz.tu-berlin.de
Newsgroups: news.software.readers