[Openvpn-devel] Ignore deprecation warning for daemon on macOS

Message ID 20220224172330.43451-1-mohsin92@me.com
State Accepted
Headers show
Series [Openvpn-devel] Ignore deprecation warning for daemon on macOS | expand

Commit Message

Kristof Provost via Openvpn-devel Feb. 24, 2022, 6:23 a.m. UTC
Follow up to a480eaa (does the same for auth-pam.c).

Signed-off-by: Saifur Rahman Mohsin<mohsin92@me.com>
---
 src/plugins/auth-pam/auth-pam.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Gert Doering Feb. 25, 2022, 11:12 p.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

Thanks for your submission.  Indeed, this is the same as Arne sent in
commit a480eaae1d32a6, which was only applied to one of the plugins in
question (plugins/down-root) and not plugins/auth-pam.

Your patch has been applied to the master branch.

commit d5c1ec2913620cec5b453c35d5c851f8c79a7ae1
Author: Saifur Rahman Mohsin via Openvpn-devel
Date:   Thu Feb 24 22:53:30 2022 +0530

     Ignore deprecation warning for daemon() on macOS (plugin/auth-pam)

     Signed-off-by: Saifur Rahman Mohsin <mohsin92@me.com>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20220224172330.43451-1-mohsin92@me.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23890.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering
Gert Doering Feb. 25, 2022, 11:15 p.m. UTC | #2
Hi,

On Sat, Feb 26, 2022 at 11:12:11AM +0100, Gert Doering wrote:
> Acked-by: Gert Doering <gert@greenie.muc.de>
> 
> Thanks for your submission.  Indeed, this is the same as Arne sent in
> commit a480eaae1d32a6, which was only applied to one of the plugins in
> question (plugins/down-root) and not plugins/auth-pam.
> 
> Your patch has been applied to the master branch.
> 
> commit d5c1ec2913620cec5b453c35d5c851f8c79a7ae1
> Author: Saifur Rahman Mohsin via Openvpn-devel

Unfortunately, I saw the "via Openvpn-devel" too late, so had to
reset "--author" to contain the correct mail address - thus, the commit
ID changed before pushing

commit cd194f552f67a1ad7951d0de9dba7448a3880805
Author: Saifur Rahman Mohsin <mohsin92@me.com>

Apologies for the confusion.

gert
Kristof Provost via Openvpn-devel Feb. 27, 2022, 12:50 a.m. UTC | #3
Hello

No worries. Thanks.

Saifur Rahman Mohsin
Technology Evangelist

On 26-Feb-2022, at 3:45 PM, Gert Doering <gert@greenie.muc.de> wrote:

Hi,

On Sat, Feb 26, 2022 at 11:12:11AM +0100, Gert Doering wrote:
> Acked-by: Gert Doering <gert@greenie.muc.de>
> 
> Thanks for your submission.  Indeed, this is the same as Arne sent in
> commit a480eaae1d32a6, which was only applied to one of the plugins in
> question (plugins/down-root) and not plugins/auth-pam.
> 
> Your patch has been applied to the master branch.
> 
> commit d5c1ec2913620cec5b453c35d5c851f8c79a7ae1
> Author: Saifur Rahman Mohsin via Openvpn-devel

Unfortunately, I saw the "via Openvpn-devel" too late, so had to
reset "--author" to contain the correct mail address - thus, the commit
ID changed before pushing

commit cd194f552f67a1ad7951d0de9dba7448a3880805
Author: Saifur Rahman Mohsin <mohsin92@me.com>

Apologies for the confusion.

gert

Patch

diff --git a/src/plugins/auth-pam/auth-pam.c b/src/plugins/auth-pam/auth-pam.c
index 3be647e9..33492e9c 100644
--- a/src/plugins/auth-pam/auth-pam.c
+++ b/src/plugins/auth-pam/auth-pam.c
@@ -214,10 +214,17 @@  daemonize(const char *envp[])
         {
             fd = dup(2);
         }
+#if defined(__APPLE__) && defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
         if (daemon(0, 0) < 0)
         {
             plugin_log(PLOG_ERR|PLOG_ERRNO, MODULE, "daemonization failed");
         }
+#if defined(__APPLE__) && defined(__clang__)
+#pragma clang diagnostic pop
+#endif
         else if (fd >= 3)
         {
             dup2(fd, 2);