Commit 62646396 62646396b031ead023196feda7eea63d14075f8e by Sergey Poznyakoff

Reset the user privileges in case popauth is installed setuid.

1 parent 7f2497fe
...@@ -270,12 +270,15 @@ action_create (struct action_data *ap) ...@@ -270,12 +270,15 @@ action_create (struct action_data *ap)
270 char buf[256]; 270 char buf[256];
271 int line = 0; 271 int line = 0;
272 272
273 /* Make sure we have proper privileges if popauth is setuid */
274 setuid (getuid ());
275
273 if (ap->input_name) 276 if (ap->input_name)
274 { 277 {
275 fp = fopen (ap->input_name, "r"); 278 fp = fopen (ap->input_name, "r");
276 if (!fp) 279 if (!fp)
277 { 280 {
278 mu_error("can't create %s: %s", ap->input_name, strerror (errno)); 281 mu_error("can't open %s: %s", ap->input_name, strerror (errno));
279 return 1; 282 return 1;
280 } 283 }
281 } 284 }
......