Commit 62646396 62646396b031ead023196feda7eea63d14075f8e by Sergey Poznyakoff

Reset the user privileges in case popauth is installed setuid.

1 parent 7f2497fe
...@@ -269,13 +269,16 @@ action_create (struct action_data *ap) ...@@ -269,13 +269,16 @@ action_create (struct action_data *ap)
269 DBM_DATUM contents; 269 DBM_DATUM contents;
270 char buf[256]; 270 char buf[256];
271 int line = 0; 271 int line = 0;
272
273 /* Make sure we have proper privileges if popauth is setuid */
274 setuid (getuid ());
272 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 }
......