X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=pppd%2Fauth.c;h=cd0477780cf2111c604eaebd102fa9b0b81fa78a;hb=3d05bed7431b9c44c4beca0049b5c0e910abf2a1;hp=8180927c6dd56afa773cb56b6bebe7efd460c89f;hpb=495ba31462f32848a98ae155bca8f8dab66f8097;p=ppp.git diff --git a/pppd/auth.c b/pppd/auth.c index 8180927..cd04777 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -68,7 +68,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: auth.c,v 1.111 2006/06/04 21:56:31 paulus Exp $" +#define RCSID "$Id: auth.c,v 1.112 2006/06/18 11:26:00 paulus Exp $" #include #include @@ -409,6 +409,7 @@ setupapfile(argv) { FILE *ufile; int l; + uid_t euid; char u[MAXNAMELEN], p[MAXSECRETLEN]; char *fname; @@ -418,12 +419,13 @@ setupapfile(argv) fname = strdup(*argv); if (fname == NULL) novm("+ua file name"); + euid = geteuid(); if (seteuid(getuid()) == -1) { option_error("unable to reset uid before opening %s: %m", fname); return 0; } ufile = fopen(fname, "r"); - if (seteuid(0) == -1) + if (seteuid(euid) == -1) fatal("unable to regain privileges: %m"); if (ufile == NULL) { option_error("unable to open user login data file %s", fname);