*** src/pgp.c Sat Jul 26 01:25:57 1997 --- src/pgp.c.new Sat Jul 26 01:25:50 1997 *************** *** 111,116 **** --- 111,120 ---- #include #include #include + #ifdef linux + #include /* for David Miller's memory lock patch */ + #include /* for David Miller's memory lock patch */ + #endif #ifdef __QNX__ #include *************** *** 435,440 **** --- 439,457 ---- #ifdef DEBUG1 verbose = TRUE; #endif + + /* David Miller's memory lock patch */ + #ifdef linux /* Linux only, for now */ + if (geteuid() == 0) { /* if we have root privs */ + /* lock all current & future pages in physical memory */ + if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0) + fprintf(pgpout, LANG("\007Could not lock all pages in memory.\n")); + if (setuid(getuid()) < 0) /* drop root privs */ + fprintf(pgpout, LANG("\007Could not drop root priviliges.\n")); + } + #endif + /* end David Miller's memory lock patch */ + /* The various places one can get passwords from. * We accumulate them all into two lists. One is * to try on keys only, and is stored in no particular