aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/libc_compat/patches/readpassphrase.patch
diff options
context:
space:
mode:
authorSergey Uzhakov <uzhastik@gmail.com>2022-06-22 21:23:19 +0300
committerSergey Uzhakov <uzhastik@gmail.com>2022-06-22 21:23:19 +0300
commitb86c509aaa5b19d5659a4548395a47c9e87826e9 (patch)
tree98025d7bd574b788f6679b24f91711ea86bf07ae /contrib/libs/libc_compat/patches/readpassphrase.patch
parentf55ada30d924b55d15fad9001944df1323a9598a (diff)
downloadydb-b86c509aaa5b19d5659a4548395a47c9e87826e9.tar.gz
YQ-1154: allow pg translator in OSS
ref:bc7b8dcc7b45e5f527a87a1bed622dff6f06d41a
Diffstat (limited to 'contrib/libs/libc_compat/patches/readpassphrase.patch')
-rw-r--r--contrib/libs/libc_compat/patches/readpassphrase.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/contrib/libs/libc_compat/patches/readpassphrase.patch b/contrib/libs/libc_compat/patches/readpassphrase.patch
new file mode 100644
index 0000000000..876b7306b3
--- /dev/null
+++ b/contrib/libs/libc_compat/patches/readpassphrase.patch
@@ -0,0 +1,43 @@
+--- a/readpassphrase.c (index)
++++ b/readpassphrase.c (working tree)
+@@ -32,6 +32,16 @@
+ #include <unistd.h>
+ #include <readpassphrase.h>
+
++#ifndef TCSASOFT
++/* If we don't have TCSASOFT define it so that ORing it it below is a no-op. */
++# define TCSASOFT 0
++#endif
++
++/* SunOS 4.x which lacks _POSIX_VDISABLE, but has VDISABLE */
++#if !defined(_POSIX_VDISABLE) && defined(VDISABLE)
++# define _POSIX_VDISABLE VDISABLE
++#endif
++
+ static volatile sig_atomic_t signo[_NSIG];
+
+ static void handler(int);
+@@ -91,8 +91,6 @@ restart:
+ memcpy(&term, &oterm, sizeof(term));
+ if (!(flags & RPP_ECHO_ON))
+ term.c_lflag &= ~(ECHO | ECHONL);
+- if (term.c_cc[VSTATUS] != _POSIX_VDISABLE)
+- term.c_cc[VSTATUS] = _POSIX_VDISABLE;
+ (void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term);
+ } else {
+ memset(&term, 0, sizeof(term));
+@@ -177,14 +187,6 @@ restart:
+ }
+
+
+-char *
+-getpass(const char *prompt)
+-{
+- static char buf[_PASSWORD_LEN + 1];
+-
+- return(readpassphrase(prompt, buf, sizeof(buf), RPP_ECHO_OFF));
+-}
+-
+ static void handler(int s)
+ {
+