2020-08-03 17:45:36 +02:00
|
|
|
--- pppd/main.c.orig
|
2008-09-15 12:22:18 +02:00
|
|
|
+++ pppd/main.c
|
- Update to version 2.5.0. This release is a major release of pppd
which contains breaking changes for third-party plugins, a
complete revamp of the build-system and that allows for
flexibility of configuring features as needed.
* Support for PEAP authentication
* Support for loading PKCS12 certificate envelopes
* Adoption of GNU Autoconf / Automake build environment
* Support for pkgconfig
* Bunch of fixes and cleanup to PPPoE and IPv6 support
* Major revision to PPPD's Plugin API
* Lots of internal fixes and cleanups for Radius and PPPoE
* Dropped IPX support, as Linux has dropped it in version 5.15
* Pppd is no longer installed setuid-root
* New pppd options:
- ipv6cp-noremote, ipv6cp-nosend, ipv6cp-use-remotenumber,
ipv6-up-script, ipv6-down-script
- -v, show-options
- usepeerwins, ipcp-no-address, ipcp-no-addresses, nosendip
* On Linux, any baud rate can be set on a serial port provided
the kernel serial driver supports that.
- Obsoleted patches:
* ppp-lib64.patch
* ppp-compiling-with-clang-encounters-an-error-in-eap-tls..patch
* ppp-pie.patch
- Enable support for systemd notification.
OBS-URL: https://build.opensuse.org/package/show/network/ppp?expand=0&rev=75
2023-07-05 17:45:43 +02:00
|
|
|
@@ -1632,14 +1632,6 @@ ppp_safe_fork(int infd, int outfd, int e
|
2006-12-19 17:17:30 +01:00
|
|
|
int fd, pipefd[2];
|
|
|
|
char buf[1];
|
|
|
|
|
|
|
|
- /* make sure fds 0, 1, 2 are occupied (probably not necessary) */
|
|
|
|
- while ((fd = dup(fd_devnull)) >= 0) {
|
|
|
|
- if (fd > 2) {
|
|
|
|
- close(fd);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (pipe(pipefd) == -1)
|
|
|
|
pipefd[0] = pipefd[1] = -1;
|
|
|
|
pid = fork();
|
- Update to version 2.5.0. This release is a major release of pppd
which contains breaking changes for third-party plugins, a
complete revamp of the build-system and that allows for
flexibility of configuring features as needed.
* Support for PEAP authentication
* Support for loading PKCS12 certificate envelopes
* Adoption of GNU Autoconf / Automake build environment
* Support for pkgconfig
* Bunch of fixes and cleanup to PPPoE and IPv6 support
* Major revision to PPPD's Plugin API
* Lots of internal fixes and cleanups for Radius and PPPoE
* Dropped IPX support, as Linux has dropped it in version 5.15
* Pppd is no longer installed setuid-root
* New pppd options:
- ipv6cp-noremote, ipv6cp-nosend, ipv6cp-use-remotenumber,
ipv6-up-script, ipv6-down-script
- -v, show-options
- usepeerwins, ipcp-no-address, ipcp-no-addresses, nosendip
* On Linux, any baud rate can be set on a serial port provided
the kernel serial driver supports that.
- Obsoleted patches:
* ppp-lib64.patch
* ppp-compiling-with-clang-encounters-an-error-in-eap-tls..patch
* ppp-pie.patch
- Enable support for systemd notification.
OBS-URL: https://build.opensuse.org/package/show/network/ppp?expand=0&rev=75
2023-07-05 17:45:43 +02:00
|
|
|
@@ -1663,25 +1655,31 @@ ppp_safe_fork(int infd, int outfd, int e
|
2020-08-03 17:45:36 +02:00
|
|
|
tdb_close(pppdb);
|
2006-12-19 17:17:30 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
- /* make sure infd, outfd and errfd won't get tromped on below */
|
|
|
|
- if (infd == 1 || infd == 2)
|
|
|
|
- infd = dup(infd);
|
|
|
|
- if (outfd == 0 || outfd == 2)
|
|
|
|
- outfd = dup(outfd);
|
|
|
|
- if (errfd == 0 || errfd == 1)
|
|
|
|
- errfd = dup(errfd);
|
2008-09-15 12:22:18 +02:00
|
|
|
-
|
|
|
|
+ /* make sure fds 0, 1, 2 are occupied, so the duplicated fds always > 2 */
|
|
|
|
+ while ((fd = dup(fd_devnull)) >= 0) {
|
|
|
|
+ if (fd > 2) {
|
|
|
|
+ close(fd);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /* always copy fd's to avoid to use a already closed fd later */
|
|
|
|
+ {
|
|
|
|
+ int fdi = infd, fdo = outfd;
|
|
|
|
+
|
|
|
|
+ infd = dup(infd);
|
|
|
|
+ outfd = dup(outfd);
|
|
|
|
+ if (errfd >= 0) {
|
|
|
|
+ fd = errfd;
|
|
|
|
+ errfd = dup(errfd);
|
|
|
|
+ close(fd);
|
|
|
|
+ }
|
|
|
|
+ close(fdi);
|
|
|
|
+ close(fdo);
|
|
|
|
+ }
|
|
|
|
closelog();
|
2006-12-19 17:17:30 +01:00
|
|
|
|
|
|
|
- /* dup the in, out, err fds to 0, 1, 2 */
|
|
|
|
- if (infd != 0)
|
|
|
|
- dup2(infd, 0);
|
|
|
|
- if (outfd != 1)
|
|
|
|
- dup2(outfd, 1);
|
|
|
|
- if (errfd != 2)
|
|
|
|
- dup2(errfd, 2);
|
2008-09-15 12:22:18 +02:00
|
|
|
-
|
2006-12-19 17:17:30 +01:00
|
|
|
- if (log_to_fd > 2)
|
2008-09-15 12:22:18 +02:00
|
|
|
+ if (log_to_fd > 0)
|
2006-12-19 17:17:30 +01:00
|
|
|
close(log_to_fd);
|
|
|
|
if (the_channel->close)
|
|
|
|
(*the_channel->close)();
|
- Update to version 2.5.0. This release is a major release of pppd
which contains breaking changes for third-party plugins, a
complete revamp of the build-system and that allows for
flexibility of configuring features as needed.
* Support for PEAP authentication
* Support for loading PKCS12 certificate envelopes
* Adoption of GNU Autoconf / Automake build environment
* Support for pkgconfig
* Bunch of fixes and cleanup to PPPoE and IPv6 support
* Major revision to PPPD's Plugin API
* Lots of internal fixes and cleanups for Radius and PPPoE
* Dropped IPX support, as Linux has dropped it in version 5.15
* Pppd is no longer installed setuid-root
* New pppd options:
- ipv6cp-noremote, ipv6cp-nosend, ipv6cp-use-remotenumber,
ipv6-up-script, ipv6-down-script
- -v, show-options
- usepeerwins, ipcp-no-address, ipcp-no-addresses, nosendip
* On Linux, any baud rate can be set on a serial port provided
the kernel serial driver supports that.
- Obsoleted patches:
* ppp-lib64.patch
* ppp-compiling-with-clang-encounters-an-error-in-eap-tls..patch
* ppp-pie.patch
- Enable support for systemd notification.
OBS-URL: https://build.opensuse.org/package/show/network/ppp?expand=0&rev=75
2023-07-05 17:45:43 +02:00
|
|
|
@@ -1689,12 +1687,18 @@ ppp_safe_fork(int infd, int outfd, int e
|
2006-12-19 17:17:30 +01:00
|
|
|
close(devfd); /* some plugins don't have a close function */
|
|
|
|
close(fd_ppp);
|
|
|
|
close(fd_devnull);
|
|
|
|
- if (infd != 0)
|
|
|
|
- close(infd);
|
|
|
|
- if (outfd != 1)
|
|
|
|
- close(outfd);
|
|
|
|
- if (errfd != 2)
|
2008-09-15 12:22:18 +02:00
|
|
|
- close(errfd);
|
2006-12-19 17:17:30 +01:00
|
|
|
+
|
|
|
|
+ close(0);
|
2008-09-15 12:22:18 +02:00
|
|
|
+ dup2(infd, 0);
|
|
|
|
+ close(infd);
|
|
|
|
+ close(1);
|
|
|
|
+ dup2(outfd, 1);
|
|
|
|
+ close(outfd);
|
|
|
|
+ if (errfd >= 0) {
|
|
|
|
+ close(2);
|
|
|
|
+ dup2(errfd, 2);
|
|
|
|
+ close(errfd);
|
2006-12-19 17:17:30 +01:00
|
|
|
+ }
|
|
|
|
|
|
|
|
notify(fork_notifier, 0);
|
|
|
|
close(pipefd[0]);
|