Re: getpwnam() restricted in a chrooted environment?
site_archiver@lists.apple.com Delivered-To: Darwin-dev@lists.apple.com Thanks, Terry, for responding, Sorry, Axel Am 10.03.2009 um 18:19 schrieb Terry Lambert: -- Terry On Mar 10, 2009, at 9:39 AM, Axel Rau <Axel.Rau@chaos1.de> wrote: Hi all, Is getpwnam() restricted some how in a chrooted environment? Any help greatly appreciated, Axel --- ar3 --- ar3 _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... not I created the chrooted environment, the the hylafax daemon does a chroot(). My problem has disappeared magically after a complete restart of all hylafax components. Most likely you failed to copy sufficient DS data files or plugins into your chroot environment; I believe the uucp user is stored in an XML file along side other local account files. You are aware that this code isn't going to actually work to lock access to the modem serial device becuase it puts its lock file in a subdirectory of /var and the /var in your chroot isn't the same as the one outside, so if access is contended inside and outside the chroot or in multiple chroot at the same time, then the programs won't see each others lock files, right? If you are planning to multiplex inbound and outbound fax and data or voice calls on the same device, rather than using it only for fax, you will need to come up with a different locking strategy that all parties respect, which probably means replacing this code completely. The hylafax code, as written, was really never intended to live in chroot environments. while installing hylafax 5.2.8 on darwin 9, getpwnam fails on the chrooted server. The relevant function is: ------------- void UUCPLock::setupIDs() { if (UUCPuid == (uid_t) -1) { const passwd *pwd = getpwnam("uucp"); if (!pwd) faxApp::fatal("Can not deduce identity of UUCP"); UUCPuid = pwd->pw_uid; UUCPgid = pwd->pw_gid; endpwent(); // paranoia } } ------------- Putting the code in a small c-program, it runs as expected. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/tlambert %40apple.com This email sent to tlambert@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Axel Rau