Drop daemon privilegies
Brilliantov Kirill Vladimirovich
brilliantov at byterg.ru
Fri Nov 25 08:03:52 UTC 2011
Souf wrote on 11/24/2011 11:00 PM:
> There is an example in httpd:
>
> #if ENABLE_FEATURE_HTTPD_SETUID
> /* drop privileges */
> if (opt & OPT_SETUID) {
> if (ugid.gid != (gid_t)-1) {
> if (setgroups(1, &ugid.gid) == -1)
> bb_perror_msg_and_die("setgroups");
> xsetgid(ugid.gid);
> }
> xsetuid(ugid.uid);
> }
> #endif
>
Thank yor for your answer Souf!
I try add in my code setgroups, but it is not solve problem.
--
Best regards,
Brilliantov Kirill Vladimirovich
More information about the busybox
mailing list