mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
dtprintinfo: don't use rresvport() on Linux systems using the musl C library
Disable binding a privileged client port with rresvport() on Linux systems using the musl C library, where that function is unsupported. If there is a need for XPrint support, a BSD-licensed implementation of rresvport() is available in the portable edition of OpenSSH.
This commit is contained in:
parent
f7227e1b74
commit
9a695e9411
1 changed files with 9 additions and 1 deletions
|
@ -195,8 +195,16 @@ int ConnectToPrintServer(const char *rhost, int timeout)
|
|||
// run as user's UID, but with privileges from root
|
||||
SETEUID(0);
|
||||
|
||||
// Try connecting to the server.
|
||||
// Try connecting to the server from a privileged port.
|
||||
/* FIXME: Test for the presence of rresvport and provide a substitute
|
||||
* if necessary. Linux C library support:
|
||||
* dietlibc: no rresvport, defines __dietlibc__
|
||||
* musl: no rresvport
|
||||
* uclibc: rresvport, defines __GLIBC__
|
||||
*/
|
||||
#if !defined(__linux__) || defined(__GLIBC__)
|
||||
s = rresvport(&lport);
|
||||
#endif
|
||||
|
||||
signal(SIGALRM, connect_timeout);
|
||||
if (timeout > 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue