[PATCH] cygheap_pwdgrp: Handle invalid db_* entries correctly

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] cygheap_pwdgrp: Handle invalid db_* entries correctly

cygwin-patches mailing list
If the first scheme in db_* was invalid, the code would think there
were no schemes specified and replace the second scheme with
NSS_SCHEME_DESC.

Signed-off-by: David Macek <[hidden email]>
---
 winsup/cygwin/uinfo.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index bfcce00da0..be3c4855cc 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -823,7 +823,10 @@ cygheap_pwdgrp::nss_init_line (const char *line)
   c, e - c);
     }
   else
-    debug_printf ("Invalid nsswitch.conf content: %s", line);
+    {
+      debug_printf ("Invalid nsswitch.conf content: %s", line);
+      --idx;
+    }
   c += strcspn (c, " \t");
   c += strspn (c, " \t");
   ++idx;
--
2.26.1.windows.1

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] cygheap_pwdgrp: Handle invalid db_* entries correctly

Corinna Vinschen-2
On Apr 16 23:09, David Macek via Cygwin-patches wrote:

> If the first scheme in db_* was invalid, the code would think there
> were no schemes specified and replace the second scheme with
> NSS_SCHEME_DESC.
>
> Signed-off-by: David Macek <[hidden email]>
> ---
>  winsup/cygwin/uinfo.cc | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
> index bfcce00da0..be3c4855cc 100644
> --- a/winsup/cygwin/uinfo.cc
> +++ b/winsup/cygwin/uinfo.cc
> @@ -823,7 +823,10 @@ cygheap_pwdgrp::nss_init_line (const char *line)
>    c, e - c);
>      }
>    else
> -    debug_printf ("Invalid nsswitch.conf content: %s", line);
> +    {
> +      debug_printf ("Invalid nsswitch.conf content: %s", line);
> +      --idx;
> +    }
>    c += strcspn (c, " \t");
>    c += strspn (c, " \t");
>    ++idx;
> --
> 2.26.1.windows.1
Pushed.

Thanks,
Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment