On Wed, Jun 15, 2005 at 07:33:39PM +0200, Thomas Glanzmann wrote:
> I would really like to encrypt some of my bookmarks. I tried the
> following, but lftp hangs itself when I do it that way. Is it possible
> to source the output of gpg -d and let gpg ask a passphrase?

Does this patch help?

--
   Alexander.                      | http://www.yars.free.net/~lav/  
Index: FileFeeder.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/FileFeeder.cc,v
retrieving revision 1.6
diff -u -p -r1.6 FileFeeder.cc
--- FileFeeder.cc       17 Feb 2004 10:44:21 -0000      1.6
+++ FileFeeder.cc       17 Jun 2005 14:16:43 -0000
@@ -35,6 +35,8 @@ const char *FileFeeder::NextCmd(CmdExec 
       }
       return "";
    }
+   if(fg_data==0)    // feeder is always in foreground.
+      fg_data=new FgData(in->GetProcGroup(),true);
    in->Kill(SIGCONT);
    int res=read(fd,buffer,buffer_size-1);
    if(res==0)
Index: FileFeeder.h
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/FileFeeder.h,v
retrieving revision 1.2
diff -u -p -r1.2 FileFeeder.h
--- FileFeeder.h        17 Dec 2003 08:30:33 -0000      1.2
+++ FileFeeder.h        17 Jun 2005 14:17:55 -0000
@@ -28,16 +28,20 @@ class FileFeeder : public CmdFeeder
    FDStream *in;
    enum { buffer_size=0x1000 };
    char buffer[buffer_size];
+   FgData *fg_data;
 public:
    const char *NextCmd(CmdExec *exec,const char *prompt);
    FileFeeder(FDStream *in)
    {
       this->in=in;
+      fg_data=0;
    }
    virtual ~FileFeeder()
    {
-      if(in)
-        delete in;
+      if(fg_data)
+        fg_data->Bg();
+      delete fg_data;
+      delete in;
    }
 };
 

Reply via email to