Re: Minires truncates host names
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 pgp9SJplWhvhA.pgp Description: PGP signature
Re: Minires truncates host names
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
Re: Minires truncates host names
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 pgpPkv5mTrTCn.pgp Description: PGP signature
Re: Minires truncates host names
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 dan...@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 > 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 Canonify2returns: daniel < @ cygwin . com . > canonify returns: daniel < @ cygwin . com . > Parse0 input: daniel < @ cygwin . com . > Parse0 returns: daniel < @ cygwin . com . > CanonAddrreturns: 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
Re: Minires truncates host names
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 pgpbh3cpugqVR.pgp Description: PGP signature
Re: Minires truncates host names
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 pgpACagYs9dGh.pgp Description: PGP signature
Re: Minires truncates host names
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
Re: Minires truncates host names
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 (anrdae...@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
Re: Minires truncates host names
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 pgp1IPoEhMnWj.pgp Description: PGP signature
Re: Minires truncates host names
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
Re: Minires truncates host names
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
Re: Minires truncates host names
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
Re: Minires truncates host names
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 pgpa8MxTzGf5L.pgp Description: PGP signature
Re: Minires truncates host names
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_ ? "" : > > # 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 pgpVgyF7UqGP9.pgp Description: PGP signature
Re: Minires truncates host names
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
RE: Minires truncates host names
> -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_ ? "" : > # 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
Re: Minires truncates host names
"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 dan...@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_ ? "" : # 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
RE: Minires truncates host names
> -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 dan...@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 > > > 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 > Canonify2returns: daniel < @ cygwin . com > > canonify returns: daniel < @ cygwin . com > > Parse0 input: daniel < @ cygwin . com > > Parse0 returns: daniel < @ cygwin . com > > CanonAddrreturns: 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 dan...@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
Minires truncates host names
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 dan...@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 > 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 Canonify2returns: daniel < @ cygwin . com > canonify returns: daniel < @ cygwin . com > Parse0 input: daniel < @ cygwin . com > Parse0 returns: daniel < @ cygwin . com > CanonAddrreturns: 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