public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: Minires truncates host names
@ 2014-07-06 23:48 Pierre A. Humblet
  2014-07-07  5:23 ` D. Boland
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Pierre A. Humblet @ 2014-07-06 23:48 UTC (permalink / raw)
  To: cygwin

> -----Original Message-----
> From: D. Boland
> Sent: Sunday, July 06, 2014 03:08
> 
> Thanks for the swift reply!
> 
> I looked at Sendmails' source code. Here's the snippet which produces 
> the output from my first email. It's taken from the file
sendmail/domain.c:
> 
>                         sm_dprintf("dns_getcanonname: trying %s.%s
(%s)\n",
>                                 host, *dp, # if NETINET6
>                                 qtype == T_AAAA ? "AAAA" :
> # endif /* NETINET6 */
>                                 qtype == T_A ? "A" :
>                                 qtype == T_MX ? "MX" :
>                                 "???");
>                 errno = 0;
>                 ret = res_querydomain(host, *dp, C_IN, qtype,
>                                       answer.qb2, sizeof(answer.qb2));
> 
> 
> As you can see, it first prints the host to be looked up, and then 
> passes the string unaltered to res_querydomain.
> 

You are right, there is a bug in res_querydomain, 
Line 737 *(ptr++ - 1) = '.';   should be
*ptr++ = '.';
 
I would also add a debug printf at the top of the function:
DPRINTF(statp->options & RES_DEBUG, "querydomain \"%s\"  \"%s\" type %d\n",
Name, DomName, Type);

Unfortunately I am not setup to build Cygwin so I can't test the above nor
submit a proper patch.

Pierre


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-06 23:48 Minires truncates host names Pierre A. Humblet
@ 2014-07-07  5:23 ` D. Boland
  2014-07-07  8:45   ` Corinna Vinschen
  2014-07-07  8:41 ` Corinna Vinschen
  2014-07-17 18:10 ` D. Boland
  2 siblings, 1 reply; 19+ messages in thread
From: D. Boland @ 2014-07-07  5:23 UTC (permalink / raw)
  To: cygwin

Hi Pierre,

"Pierre A. Humblet" wrote:
> 
> You are right, there is a bug in res_querydomain,
> Line 737 *(ptr++ - 1) = '.';   should be
> *ptr++ = '.';
> 
> I would also add a debug printf at the top of the function:
> DPRINTF(statp->options & RES_DEBUG, "querydomain \"%s\"  \"%s\" type %d\n",
> Name, DomName, Type);
> 
> Unfortunately I am not setup to build Cygwin so I can't test the above nor
> submit a proper patch.

I downloaded the source code from your site:

ftp://ftp.franken.de/pub/support/win32/develop/gnuwin32/cygwin/porters/Humblet_Pierre_A/V1.5/minires-0.97-src.tar.gz

After a 'make', I get multiple warnings and errors, for example:

resolver.h:48:6: fout: conflicting types for `dprintf´
 void dprintf(char * format, ...);
      ^
In file included from /usr/include/string.h:10:0,
                 from resolver.h:16,
                 from minires.c:14:
/usr/include/stdio.h:337:5: note: previous declaration of `dprintf´ was here
 int _EXFUN(dprintf, (int, const char *__restrict, ...)
     ^

Looks like the dprintf function is already defined in stdio.h. Are you using gcc?

Greetings,
Daniel


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-06 23:48 Minires truncates host names Pierre A. Humblet
  2014-07-07  5:23 ` D. Boland
@ 2014-07-07  8:41 ` Corinna Vinschen
  2014-07-11  5:55   ` D. Boland
  2014-07-17 18:10 ` D. Boland
  2 siblings, 1 reply; 19+ messages in thread
From: Corinna Vinschen @ 2014-07-07  8:41 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1818 bytes --]

On Jul  6 19:47, Pierre A. Humblet wrote:
> > -----Original Message-----
> > From: D. Boland
> > Sent: Sunday, July 06, 2014 03:08
> > 
> > Thanks for the swift reply!
> > 
> > I looked at Sendmails' source code. Here's the snippet which produces 
> > the output from my first email. It's taken from the file
> sendmail/domain.c:
> > 
> >                         sm_dprintf("dns_getcanonname: trying %s.%s
> (%s)\n",
> >                                 host, *dp, # if NETINET6
> >                                 qtype == T_AAAA ? "AAAA" :
> > # endif /* NETINET6 */
> >                                 qtype == T_A ? "A" :
> >                                 qtype == T_MX ? "MX" :
> >                                 "???");
> >                 errno = 0;
> >                 ret = res_querydomain(host, *dp, C_IN, qtype,
> >                                       answer.qb2, sizeof(answer.qb2));
> > 
> > 
> > As you can see, it first prints the host to be looked up, and then 
> > passes the string unaltered to res_querydomain.
> > 
> 
> You are right, there is a bug in res_querydomain, 
> Line 737 *(ptr++ - 1) = '.';   should be
> *ptr++ = '.';
>  
> I would also add a debug printf at the top of the function:
> DPRINTF(statp->options & RES_DEBUG, "querydomain \"%s\"  \"%s\" type %d\n",
> Name, DomName, Type);
> 
> Unfortunately I am not setup to build Cygwin so I can't test the above nor
> submit a proper patch.

I've checked that in.  I also changed the debug output to print
"Resolv" instead of "Minires" to make sure that people don't think
they are stil using the external Minres lib.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-07  5:23 ` D. Boland
@ 2014-07-07  8:45   ` Corinna Vinschen
  0 siblings, 0 replies; 19+ messages in thread
From: Corinna Vinschen @ 2014-07-07  8:45 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1302 bytes --]

On Jul  7 07:27, D. Boland wrote:
> Hi Pierre,
> 
> "Pierre A. Humblet" wrote:
> > 
> > You are right, there is a bug in res_querydomain,
> > Line 737 *(ptr++ - 1) = '.';   should be
> > *ptr++ = '.';
> > 
> > I would also add a debug printf at the top of the function:
> > DPRINTF(statp->options & RES_DEBUG, "querydomain \"%s\"  \"%s\" type %d\n",
> > Name, DomName, Type);
> > 
> > Unfortunately I am not setup to build Cygwin so I can't test the above nor
> > submit a proper patch.
> 
> I downloaded the source code from your site:
> 
> ftp://ftp.franken.de/pub/support/win32/develop/gnuwin32/cygwin/porters/Humblet_Pierre_A/V1.5/minires-0.97-src.tar.gz

You're in the wrong spot.  The minres code has been folded into the
Cygwin DLL years ago, with the switch from Cygwin 1.5 to 1.7.  There's
no external resolver lib in the Cygwin distro anymore since then.  The
Minires package is only provided by the 32 bit distro for backward
compatibility with very old packages.  Don't try to link against this
DLL at all for new packages:  -lresolv will link your resolver calls
to the Cygwin DLL's resolver calls.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-07  8:41 ` Corinna Vinschen
@ 2014-07-11  5:55   ` D. Boland
  2014-07-11  9:31     ` Marco Atzeri
  0 siblings, 1 reply; 19+ messages in thread
From: D. Boland @ 2014-07-11  5:55 UTC (permalink / raw)
  To: cygwin

Hi Corinna,

Corinna Vinschen wrote:
> 
> I've checked that in.  I also changed the debug output to print
> "Resolv" instead of "Minires" to make sure that people don't think
> they are stil using the external Minres lib.
> 

How can I test the new code? I've tried updating with the Cygwin install program,
but the error is still there.

$ uname -a
CYGWIN_NT-5.1 dimension 1.7.30(0.272/5/3) 2014-05-23 10:36 i686 Cygwin

Also, I'm afraid I'm not done yet. Sendmail passes the dot as the root domain, which
I think is legitimate:

	res_querydomain("cygwin.com", ".", .......

Is there a way for me to test the resolver code?

Daniel


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-11  5:55   ` D. Boland
@ 2014-07-11  9:31     ` Marco Atzeri
  0 siblings, 0 replies; 19+ messages in thread
From: Marco Atzeri @ 2014-07-11  9:31 UTC (permalink / raw)
  To: cygwin

On 11/07/2014 08:00, D. Boland wrote:
> Hi Corinna,
>
> Corinna Vinschen wrote:
>>
>> I've checked that in.  I also changed the debug output to print
>> "Resolv" instead of "Minires" to make sure that people don't think
>> they are stil using the external Minres lib.
>>
>
> How can I test the new code? I've tried updating with the Cygwin install program,
> but the error is still there.
>
> $ uname -a
> CYGWIN_NT-5.1 dimension 1.7.30(0.272/5/3) 2014-05-23 10:36 i686 Cygwin
>
> Also, I'm afraid I'm not done yet. Sendmail passes the dot as the root domain, which
> I think is legitimate:
>
> 	res_querydomain("cygwin.com", ".", .......
>
> Is there a way for me to test the resolver code?
>
> Daniel
>

Hi Daniel
test version is here:
https://cygwin.com/snapshots/

it should be enough to move away the current cygwin1.dll and replace in
bin the latest snapshots cygwin1.dll.
Of course all cygwin processes must be shutdown before.


Regards
Marco



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-06 23:48 Minires truncates host names Pierre A. Humblet
  2014-07-07  5:23 ` D. Boland
  2014-07-07  8:41 ` Corinna Vinschen
@ 2014-07-17 18:10 ` D. Boland
  2014-07-17 18:23   ` Corinna Vinschen
  2014-07-17 18:35   ` Andrey Repin
  2 siblings, 2 replies; 19+ messages in thread
From: D. Boland @ 2014-07-17 18:10 UTC (permalink / raw)
  To: cygwin

Hi Pierre,

"Pierre A. Humblet" wrote:
> 
> You are right, there is a bug in res_querydomain,
> Line 737 *(ptr++ - 1) = '.';   should be
> *ptr++ = '.';
> 
> I would also add a debug printf at the top of the function:
> DPRINTF(statp->options & RES_DEBUG, "querydomain \"%s\"  \"%s\" type %d\n",
> Name, DomName, Type);
> 
> Unfortunately I am not setup to build Cygwin so I can't test the above nor
> submit a proper patch.

Just letting you know how it went with the Resolver (miniedit). The error, pointed
out by you, solved the problem.

Now I have an even bigger problem. Sendmail works perfectly. But only on my XP
machine. As of Windows Vista, MS decided to remove certain privileges from the
SYSTEM user.

As a consequence, SYSTEM is no longer able to perform the 'setuid' function. This is
very much needed, since local mail has to be delivered by a mail delivery agent,
like procmail, running under the recipient's credentials.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-17 18:10 ` D. Boland
@ 2014-07-17 18:23   ` Corinna Vinschen
  2014-07-17 20:24     ` D. Boland
  2014-07-17 18:35   ` Andrey Repin
  1 sibling, 1 reply; 19+ messages in thread
From: Corinna Vinschen @ 2014-07-17 18:23 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1780 bytes --]

On Jul 17 20:14, D. Boland wrote:
> Hi Pierre,
> 
> "Pierre A. Humblet" wrote:
> > 
> > You are right, there is a bug in res_querydomain,
> > Line 737 *(ptr++ - 1) = '.';   should be
> > *ptr++ = '.';
> > 
> > I would also add a debug printf at the top of the function:
> > DPRINTF(statp->options & RES_DEBUG, "querydomain \"%s\"  \"%s\" type %d\n",
> > Name, DomName, Type);
> > 
> > Unfortunately I am not setup to build Cygwin so I can't test the above nor
> > submit a proper patch.
> 
> Just letting you know how it went with the Resolver (miniedit). The error, pointed
> out by you, solved the problem.

Did you read my previous reply?  Do *not* use the minres lib.  Use the
Cygwin resolver.  There's no minires lib on 64 bit anymore and the 32
bit runtime minres is only maintained for backward compatibility.
You can download the latest Cygwin developer snapshot DLL from
http://cygwin.com/snapshots/  It contains the aforementioned patch.

> Now I have an even bigger problem. Sendmail works perfectly. But only on my XP
> machine. As of Windows Vista, MS decided to remove certain privileges from the
> SYSTEM user.

You might have to read the user's manual in the long run ;)

https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-setuid-overview

Other services are set up so that they use another account called
cyg_server.  See, for instance, how ssh-host-config helps an admin to
set this up.  The csih package helper script is lending you a hand when
creating such service installer scripts.  See also

https://cygwin.com/faq/faq.html#faq.using.sshd-in-domain


HTH,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-17 18:10 ` D. Boland
  2014-07-17 18:23   ` Corinna Vinschen
@ 2014-07-17 18:35   ` Andrey Repin
  1 sibling, 0 replies; 19+ messages in thread
From: Andrey Repin @ 2014-07-17 18:35 UTC (permalink / raw)
  To: D. Boland, cygwin

Greetings, D. Boland!

> Now I have an even bigger problem. Sendmail works perfectly. But only on my XP
> machine. As of Windows Vista, MS decided to remove certain privileges from the
> SYSTEM user.

> As a consequence, SYSTEM is no longer able to perform the 'setuid' function. This is
> very much needed, since local mail has to be delivered by a mail delivery agent,
> like procmail, running under the recipient's credentials.

You were never expected to run any Cygwin services as NT AUTHORITY\SYSTEM user.


--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 17.07.2014, <22:30>

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-17 18:23   ` Corinna Vinschen
@ 2014-07-17 20:24     ` D. Boland
  2014-07-18  8:17       ` Corinna Vinschen
  0 siblings, 1 reply; 19+ messages in thread
From: D. Boland @ 2014-07-17 20:24 UTC (permalink / raw)
  To: cygwin

Hi Corinna,

Corinna Vinschen wrote:
> 
> On Jul 17 20:14, D. Boland wrote:
> > Hi Pierre,
> >
> > "Pierre A. Humblet" wrote:
> > >
> > > You are right, there is a bug in res_querydomain,
> > > Line 737 *(ptr++ - 1) = '.';   should be
> > > *ptr++ = '.';
> > >
> > > I would also add a debug printf at the top of the function:
> > > DPRINTF(statp->options & RES_DEBUG, "querydomain \"%s\"  \"%s\" type %d\n",
> > > Name, DomName, Type);
> > >
> > > Unfortunately I am not setup to build Cygwin so I can't test the above nor
> > > submit a proper patch.
> >
> > Just letting you know how it went with the Resolver (miniedit). The error, pointed
> > out by you, solved the problem.
> 
> Did you read my previous reply?  Do *not* use the minres lib.  Use the
> Cygwin resolver.  There's no minires lib on 64 bit anymore and the 32
> bit runtime minres is only maintained for backward compatibility.

Yes, I read it. I just don't like to swap my current Cygwin DLL. I will test it
proper on a fresh Cygwin system on another computer. When will the fix be released?

> > Now I have an even bigger problem. Sendmail works perfectly. But only on my XP
> > machine. As of Windows Vista, MS decided to remove certain privileges from the
> > SYSTEM user.
> 
> You might have to read the user's manual in the long run ;)
> 
> https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-setuid-overview

I did read it. Very well written, I might add. It looked very complicated at first
but when I read it, it made my problem very clear.

> Other services are set up so that they use another account called
> cyg_server.  See, for instance, how ssh-host-config helps an admin to
> set this up.  The csih package helper script is lending you a hand when
> creating such service installer scripts.  See also
> 
> https://cygwin.com/faq/faq.html#faq.using.sshd-in-domain

I must say, I am not a big fan of this csih thang. It totally obfuscates what I am
doing with my Cygwin server as an administrator. Also, it creates the "cyg_server"
user, which just mimicks what the SYSTEM user used to do. Maybe it should have been
called "root"?

The SYSTEM user was/is also regarded as the root user by other softwares from the
Unix world. It's in the procmail source code (#define ROOT_uid 18).

I searched for MS's position on this issue. I found this article:

http://technet.microsoft.com/en-us/library/bb457125.aspx

In the section about the SeTcbPrivilege, which the "cyg_server" user needs to log in
as another user, it reads:

---------------------
The default settings are taken from the Windows XP Professional Local Computer
policy.

Act as part of the operating system (SeTcbPrivilege)

Allows a process to assume the identity of any user and thus gain access to the
resources that the user is authorized to access. Typically, only low-level
authentication services require this privilege.

Default setting: Not assigned.

Note that potential access is not limited to what is associated with the user by
default; the calling process might request that arbitrary additional privileges be
added to the access token. The calling process might also build an access token that
does not provide a primary identity for tracking events in the audit log.

When a service requires this privilege, configure the service to log on using the
Local System account, which has the privilege inherently. Do not create a separate
account and assign the privilege to it.
-----------------

I cannot believe that MS just disabled this privilege in the newer Windows versions,
without providing an alternative. So now I'm trying the LocalService user...

Daniel


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-17 20:24     ` D. Boland
@ 2014-07-18  8:17       ` Corinna Vinschen
  2014-07-18  8:20         ` Corinna Vinschen
  2014-07-20  8:55         ` D. Boland
  0 siblings, 2 replies; 19+ messages in thread
From: Corinna Vinschen @ 2014-07-18  8:17 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 4072 bytes --]

Hi Daniel,

On Jul 17 22:29, D. Boland wrote:
> Hi Corinna,
> 
> Corinna Vinschen wrote:
> > 
> > On Jul 17 20:14, D. Boland wrote:
> > > Just letting you know how it went with the Resolver (miniedit). The error, pointed
> > > out by you, solved the problem.
> > 
> > Did you read my previous reply?  Do *not* use the minres lib.  Use the
> > Cygwin resolver.  There's no minires lib on 64 bit anymore and the 32
> > bit runtime minres is only maintained for backward compatibility.
> 
> Yes, I read it. I just don't like to swap my current Cygwin DLL. I will test it
> proper on a fresh Cygwin system on another computer. When will the fix be released?

With 1.7.31 in the next few days.  But there are still the developer
snapshots for testing.  Here's the deal: If you test a developer
snapshot you can make sure that the next release will fix the problem.
If you don't test the snapshot you won't have that privilege and the
functionality will still be broken up to the next release.  Simple.

> > > Now I have an even bigger problem. Sendmail works perfectly. But only on my XP
> > > machine. As of Windows Vista, MS decided to remove certain privileges from the
> > > SYSTEM user.
> > 
> > You might have to read the user's manual in the long run ;)
> > 
> > https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-setuid-overview
> 
> I did read it. Very well written, I might add. It looked very complicated at first
> but when I read it, it made my problem very clear.
> 
> > Other services are set up so that they use another account called
> > cyg_server.  See, for instance, how ssh-host-config helps an admin to
> > set this up.  The csih package helper script is lending you a hand when
> > creating such service installer scripts.  See also
> > 
> > https://cygwin.com/faq/faq.html#faq.using.sshd-in-domain
> 
> I must say, I am not a big fan of this csih thang. It totally obfuscates what I am
> doing with my Cygwin server as an administrator. Also, it creates the "cyg_server"
> user, which just mimicks what the SYSTEM user used to do. Maybe it should have been
> called "root"?

SYSTEM or, FWIW, cyg_server are not root.  Nor are the users in the
admin group.  The privilege concept in Windows is simply different and
trying to tweak it into shape is bound to fail one way or the other.
That's why we don't pretend any of the user accounts is actually root.

> The SYSTEM user was/is also regarded as the root user by other softwares from the
> Unix world. It's in the procmail source code (#define ROOT_uid 18).

That's a Cygwin-specific patch to change tests testing for uid 0
to tests for uid 18 by default.  But that doesn't matter.

> I searched for MS's position on this issue. I found this article:
> 
> http://technet.microsoft.com/en-us/library/bb457125.aspx
> 
> In the section about the SeTcbPrivilege, which the "cyg_server" user needs to log in
> as another user

Stop right here.  The problem is *not* SeTcbPrivilege.  SeTcbPrivilege
is only one side of the coin.  The other side is SeCreateTokenPrivilege.
Starting with Windows 2003, all services started under the SYSTEM
account get an access token with the SeCreateTokenPrivilege explicitely
removed.  That means method 1 from the user guide
(https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd1)
which at one point in the past was the *only* method, won't work.
Given that method 2 and 3 require specific administrator intervention,
method 1 is still the fallback, and it's probably in use on many
machines of users who don't want to install an LSA auth package or
to store the password in the registry.

> I cannot believe that MS just disabled this privilege in the newer Windows versions,

They didn't.  They removed SeCreateTokenPrivilege.

> without providing an alternative. So now I'm trying the LocalService user...

Good luck.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-18  8:17       ` Corinna Vinschen
@ 2014-07-18  8:20         ` Corinna Vinschen
  2014-07-20  8:55         ` D. Boland
  1 sibling, 0 replies; 19+ messages in thread
From: Corinna Vinschen @ 2014-07-18  8:20 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 847 bytes --]

On Jul 18 10:17, Corinna Vinschen wrote:
> On Jul 17 22:29, D. Boland wrote:
> > Yes, I read it. I just don't like to swap my current Cygwin DLL. I will test it
> > proper on a fresh Cygwin system on another computer. When will the fix be released?
> 
> With 1.7.31 in the next few days.  But there are still the developer
> snapshots for testing.  Here's the deal: If you test a developer
> snapshot you can make sure that the next release will fix the problem.
> If you don't test the snapshot you won't have that privilege and the
> functionality will still be broken up to the next release.  Simple.
                      ^^^^^^^^^^^
                      potentially


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-18  8:17       ` Corinna Vinschen
  2014-07-18  8:20         ` Corinna Vinschen
@ 2014-07-20  8:55         ` D. Boland
  2014-07-21  8:21           ` Corinna Vinschen
  1 sibling, 1 reply; 19+ messages in thread
From: D. Boland @ 2014-07-20  8:55 UTC (permalink / raw)
  To: cygwin

Hi Corinna,

Corinna Vinschen wrote:
> 
> Hi Daniel,
> 
> On Jul 17 22:29, D. Boland wrote:
> > Hi Corinna,
> >
> > Corinna Vinschen wrote:
> > >
> > > On Jul 17 20:14, D. Boland wrote:
> > > > Just letting you know how it went with the Resolver (miniedit). The error, pointed
> > > > out by you, solved the problem.
> > >
> > > Did you read my previous reply?  Do *not* use the minres lib.  Use the
> > > Cygwin resolver.  There's no minires lib on 64 bit anymore and the 32
> > > bit runtime minres is only maintained for backward compatibility.
> >
> > Yes, I read it. I just don't like to swap my current Cygwin DLL. I will test it
> > proper on a fresh Cygwin system on another computer. When will the fix be released?
> 
> With 1.7.31 in the next few days.  But there are still the developer
> snapshots for testing.  Here's the deal: If you test a developer
> snapshot you can make sure that the next release will fix the problem.
> If you don't test the snapshot you won't have that privilege and the
> functionality will still be broken up to the next release.  Simple.
> 

Ok, I put in the new Cygwin1.dll from the latest 32bit developer snapshot:

$ uname -a
CYGWIN_NT-5.1 dimension 1.7.31s(0.272/5/3) 20140716 11:15:29 i686 Cygwin

Then, I removed /usr/lib/resolv.a, so the call is explicitly done on the new Cygwin
DLL.

I removed the complete source code from my /usr/local/src directory, re-extracted
the sendmail source, made and installed. So now the test-output of the sendmail rule
"check_mail" looks like this:

$ echo "check_mail daniel@cygwin.com" | /usr/sbin/sendmail -d8.20 -bt
dns_getcanonname(dimension, trymx=1)
dns_getcanonname: trying dimension.sassenheim.dmz (A)
Resolv: querydomain "dimension"  "sassenheim.dmz" type 1
Resolv: query "dimension.sassenheim.dmz" type 1
Resolv: DnsQuery: 0 (Windows)
Resolv: dimension.sassenheim.dmz Section 1 Type 1 Windows Record Length 4
        YES
dns_getcanonname: dimension.sassenheim.dmz
readcf: option TrustedUser may cause problems on systems
        which do not support fchown() if UseMSP is not set.
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> check_mail         input: daniel @ cygwin . com
Basic_check_mail   input: daniel @ cygwin . com
tls_client         input: $| MAIL
TLS_connection     input:
TLS_connection   returns:
tls_client       returns:
CanonAddr          input: < daniel @ cygwin . com >
canonify           input: < daniel @ cygwin . com >
Canonify2          input: daniel < @ cygwin . com >
dns_getcanonname(cygwin.com, trymx=1)
dns_getcanonname: trying cygwin.com. (A)
Resolv: querydomain "cygwin.com"  "" type 1
Resolv: query "cygwin.com." type 1
Resolv: DnsQuery: 0 (Windows)
Resolv: cygwin.com Section 1 Type 1 Windows Record Length 4
Resolv: ns2.redhat.com Section 3 Type 1 Windows Record Length 4
Resolv: ns1.redhat.com Section 3 Type 1 Windows Record Length 4
Resolv: ns3.redhat.com Section 3 Type 1 Windows Record Length 4
        YES
dns_getcanonname: cygwin.com
Canonify2        returns: daniel < @ cygwin . com . >
canonify         returns: daniel < @ cygwin . com . >
Parse0             input: daniel < @ cygwin . com . >
Parse0           returns: daniel < @ cygwin . com . >
CanonAddr        returns: daniel < @ cygwin . com . >
Basic_check_mail returns: @ daniel < @ cygwin . com >
check_mail       returns: @ daniel < @ cygwin . com >

It works. As you can see, this is done on a WinXP machine. I could also test on a
Win7 machine. I don't have Win8 or Win8.1.

Greetings,
Daniel


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-20  8:55         ` D. Boland
@ 2014-07-21  8:21           ` Corinna Vinschen
  2014-07-21 19:07             ` D. Boland
  0 siblings, 1 reply; 19+ messages in thread
From: Corinna Vinschen @ 2014-07-21  8:21 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2222 bytes --]

On Jul 20 10:59, D. Boland wrote:
> Corinna Vinschen wrote:
> > With 1.7.31 in the next few days.  But there are still the developer
> > snapshots for testing.  Here's the deal: If you test a developer
> > snapshot you can make sure that the next release will fix the problem.
> > If you don't test the snapshot you won't have that privilege and the
> > functionality will still be broken up to the next release.  Simple.
> 
> Ok, I put in the new Cygwin1.dll from the latest 32bit developer snapshot:
> 
> $ uname -a
> CYGWIN_NT-5.1 dimension 1.7.31s(0.272/5/3) 20140716 11:15:29 i686 Cygwin
> 
> Then, I removed /usr/lib/resolv.a, so the call is explicitly done on the new Cygwin
> DLL.

No reason to do that!  libresolv.a is generated as part of the Cygwin
package.  It's not referencing the minres DLL, but the Cygwin DLL :)

> I removed the complete source code from my /usr/local/src directory, re-extracted
> the sendmail source, made and installed. So now the test-output of the sendmail rule
> "check_mail" looks like this:
> [...]
> dns_getcanonname(cygwin.com, trymx=1)
> dns_getcanonname: trying cygwin.com. (A)
> Resolv: querydomain "cygwin.com"  "" type 1
> Resolv: query "cygwin.com." type 1
> Resolv: DnsQuery: 0 (Windows)
> Resolv: cygwin.com Section 1 Type 1 Windows Record Length 4
> Resolv: ns2.redhat.com Section 3 Type 1 Windows Record Length 4
> Resolv: ns1.redhat.com Section 3 Type 1 Windows Record Length 4
> Resolv: ns3.redhat.com Section 3 Type 1 Windows Record Length 4
>         YES
> dns_getcanonname: cygwin.com
> [...]
> 
> It works. As you can see, this is done on a WinXP machine. I could also test on a
> Win7 machine. I don't have Win8 or Win8.1.

That's fine.  Thanks a lot for confirming again that Pierre's patch
works and the latest Cygwin DLL is doing the right thing here.

Out of curiosity, did you manage to build sendmail on 64 bit Cygwin yet?
And more importantly, are you going to become Cygwin maintainer for the
sendmail package?  This would be way cool.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-21  8:21           ` Corinna Vinschen
@ 2014-07-21 19:07             ` D. Boland
  2014-07-22  8:52               ` Corinna Vinschen
  0 siblings, 1 reply; 19+ messages in thread
From: D. Boland @ 2014-07-21 19:07 UTC (permalink / raw)
  To: cygwin

Hi Corinna,

Corinna Vinschen wrote:
> 
> > It works. As you can see, this is done on a WinXP machine. I could also test on a
> > Win7 machine. I don't have Win8 or Win8.1.
> 
> That's fine.  Thanks a lot for confirming again that Pierre's patch
> works and the latest Cygwin DLL is doing the right thing here.
> 
> Out of curiosity, did you manage to build sendmail on 64 bit Cygwin yet?

No, only the 32bit one yet. I need to have it working smoothly before the start of
the upcoming school year. I'm a Linux teacher in Holland.

> And more importantly, are you going to become Cygwin maintainer for the
> sendmail package?  This would be way cool.
> 

I'd be delighted! Is there some infos I should read?

Daniel


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-21 19:07             ` D. Boland
@ 2014-07-22  8:52               ` Corinna Vinschen
  0 siblings, 0 replies; 19+ messages in thread
From: Corinna Vinschen @ 2014-07-22  8:52 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1442 bytes --]

Hi Daniel,

On Jul 21 21:11, D. Boland wrote:
> Hi Corinna,
> 
> Corinna Vinschen wrote:
> > 
> > > It works. As you can see, this is done on a WinXP machine. I could also test on a
> > > Win7 machine. I don't have Win8 or Win8.1.
> > 
> > That's fine.  Thanks a lot for confirming again that Pierre's patch
> > works and the latest Cygwin DLL is doing the right thing here.
> > 
> > Out of curiosity, did you manage to build sendmail on 64 bit Cygwin yet?
> 
> No, only the 32bit one yet. I need to have it working smoothly before the start of
> the upcoming school year. I'm a Linux teacher in Holland.
> 
> > And more importantly, are you going to become Cygwin maintainer for the
> > sendmail package?  This would be way cool.
> > 
> 
> I'd be delighted! Is there some infos I should read?

https://cygwin.com/setup.html explains how a package should basically
look like.  The actual packaging should then be done via the cygport
tool, it makes creating packages pretty simple.

For uploading a package a new mechanism has been implemented which
allows a maintainer to do the upload by himself after he got the
GTG on the cygwin-apps list.  For inforamtion on this, please have
a look at https://sourceware.org/cygwin-apps/package-upload.html


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Minires truncates host names
  2014-07-05 21:37 ` Pierre A. Humblet
@ 2014-07-06  7:05   ` D. Boland
  0 siblings, 0 replies; 19+ messages in thread
From: D. Boland @ 2014-07-06  7:05 UTC (permalink / raw)
  To: cygwin

"Pierre A. Humblet" wrote:
> To me it looks like the string was already truncated when it was passed to
> the function.
> 
> You can test e.g. by using exim -d+resolver  -bt   daniel@cygwin.com
> 
> It's wonderful that you got sendmail to work.
> 
> Pierre
> 

Thanks for the swift reply!

I looked at Sendmails' source code. Here's the snippet which produces the output
from my first email. It's taken from the file sendmail/domain.c:

                        sm_dprintf("dns_getcanonname: trying %s.%s (%s)\n",
                                host, *dp,
# if NETINET6
                                qtype == T_AAAA ? "AAAA" :
# endif /* NETINET6 */
                                qtype == T_A ? "A" :
                                qtype == T_MX ? "MX" :
                                "???");
                errno = 0;
                ret = res_querydomain(host, *dp, C_IN, qtype,
                                      answer.qb2, sizeof(answer.qb2));


As you can see, it first prints the host to be looked up, and then passes the string
unaltered to res_querydomain.

I will create a source release, so it can be tested.

Daniel


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: Minires truncates host names
  2014-07-05 20:07 D. Boland
@ 2014-07-05 21:37 ` Pierre A. Humblet
  2014-07-06  7:05   ` D. Boland
  0 siblings, 1 reply; 19+ messages in thread
From: Pierre A. Humblet @ 2014-07-05 21:37 UTC (permalink / raw)
  To: 'D. Boland'; +Cc: cygwin

> -----Original Message-----
> From: D. Boland
> Sent: Saturday, July 05, 2014 16:12
> 
> Hi Group,
> 
> I finally got Sendmail ported to Cygwin. But when looking up valid
hostnames
> from sender addresses, Minires fails. Here's the output, testing one of
> Sendmails' rules.
> 
> $ echo "check_mail daniel@cygwin.com" | /usr/sbin/sendmail -d8.20 -bt
> readcf: option TrustedUser may cause problems on systems
>         which do not support fchown() if UseMSP is not set.
> ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset>
> <address>
> > check_mail         input: daniel @ cygwin . com
> Basic_check_mail   input: daniel @ cygwin . com
> tls_client         input: $| MAIL
> TLS_connection     input:
> TLS_connection   returns:
> tls_client       returns:
> CanonAddr          input: < daniel @ cygwin . com >
> canonify           input: < daniel @ cygwin . com >
> Canonify2          input: daniel < @ cygwin . com >
> dns_getcanonname(cygwin.com, trymx=1)
> dns_getcanonname: trying cygwin.com. (A)
> Minires: query "cygwin.co." type 1
> Minires: DnsQuery: 9003 (Windows)
>         NO: errno=0, h_errno=1
> Canonify2        returns: daniel < @ cygwin . com >
> canonify         returns: daniel < @ cygwin . com >
> Parse0             input: daniel < @ cygwin . com >
> Parse0           returns: daniel < @ cygwin . com >
> CanonAddr        returns: daniel < @ cygwin . com >
> Basic_check_mail returns: $# error $@ 5 . 1 . 8 $: "553 Domain of sender
> address " "
> does not exist"
> check_mail       returns: $# error $@ 5 . 1 . 8 $: "553 Domain of sender
> address " "
> does not exist"
> >
> 
> As can be seen, Minires queries "cygwin.co.", not "cygwin.com." Is this a
> bug? Is there a way to test Minires lookups outside of Sendmail?

The Minires output above is produced at the top of the res_nquery function
by the following lines

int res_nquery( res_state statp, const char * DomName, int Class, int Type, 
695                 unsigned char * AnsPtr, int AnsLength) 
696 { 
697   u_char packet[PACKETSZ]; 
698   int len; 
699  
700   DPRINTF(statp->options & RES_DEBUG, "query \"%s\" type %d\n", DomName,
Type);  

To me it looks like the string was already truncated when it was passed to
the function.

You can test e.g. by using exim -d+resolver  -bt   daniel@cygwin.com

It's wonderful that you got sendmail to work.

Pierre
 



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Minires truncates host names
@ 2014-07-05 20:07 D. Boland
  2014-07-05 21:37 ` Pierre A. Humblet
  0 siblings, 1 reply; 19+ messages in thread
From: D. Boland @ 2014-07-05 20:07 UTC (permalink / raw)
  To: cygwin

Hi Group,

I finally got Sendmail ported to Cygwin. But when looking up valid hostnames from
sender addresses, Minires fails. Here's the output, testing one of Sendmails' rules.

$ echo "check_mail daniel@cygwin.com" | /usr/sbin/sendmail -d8.20 -bt
readcf: option TrustedUser may cause problems on systems
        which do not support fchown() if UseMSP is not set.
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> check_mail         input: daniel @ cygwin . com
Basic_check_mail   input: daniel @ cygwin . com
tls_client         input: $| MAIL
TLS_connection     input:
TLS_connection   returns:
tls_client       returns:
CanonAddr          input: < daniel @ cygwin . com >
canonify           input: < daniel @ cygwin . com >
Canonify2          input: daniel < @ cygwin . com >
dns_getcanonname(cygwin.com, trymx=1)
dns_getcanonname: trying cygwin.com. (A)
Minires: query "cygwin.co." type 1
Minires: DnsQuery: 9003 (Windows)
        NO: errno=0, h_errno=1
Canonify2        returns: daniel < @ cygwin . com >
canonify         returns: daniel < @ cygwin . com >
Parse0             input: daniel < @ cygwin . com >
Parse0           returns: daniel < @ cygwin . com >
CanonAddr        returns: daniel < @ cygwin . com >
Basic_check_mail returns: $# error $@ 5 . 1 . 8 $: "553 Domain of sender address " "
does not exist"
check_mail       returns: $# error $@ 5 . 1 . 8 $: "553 Domain of sender address " "
does not exist"
>

As can be seen, Minires queries "cygwin.co.", not "cygwin.com." Is this a bug? Is
there a way to test Minires lookups outside of Sendmail?

Greetings,
Daniel


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2014-07-22  8:52 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-06 23:48 Minires truncates host names Pierre A. Humblet
2014-07-07  5:23 ` D. Boland
2014-07-07  8:45   ` Corinna Vinschen
2014-07-07  8:41 ` Corinna Vinschen
2014-07-11  5:55   ` D. Boland
2014-07-11  9:31     ` Marco Atzeri
2014-07-17 18:10 ` D. Boland
2014-07-17 18:23   ` Corinna Vinschen
2014-07-17 20:24     ` D. Boland
2014-07-18  8:17       ` Corinna Vinschen
2014-07-18  8:20         ` Corinna Vinschen
2014-07-20  8:55         ` D. Boland
2014-07-21  8:21           ` Corinna Vinschen
2014-07-21 19:07             ` D. Boland
2014-07-22  8:52               ` Corinna Vinschen
2014-07-17 18:35   ` Andrey Repin
  -- strict thread matches above, loose matches on Subject: below --
2014-07-05 20:07 D. Boland
2014-07-05 21:37 ` Pierre A. Humblet
2014-07-06  7:05   ` D. Boland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).