* [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. @ 2018-06-13 15:29 Takashi Yano 2018-06-13 15:44 ` Csaba Raduly 2018-06-13 19:58 ` Corinna Vinschen 0 siblings, 2 replies; 20+ messages in thread From: Takashi Yano @ 2018-06-13 15:29 UTC (permalink / raw) To: cygwin Hi, I have found that iu-config of inetutils package fails to set the privileged rights to cyg_server on Windows 7 if the machine is not domain member. I looked into this problem, and found that this is the problem of csih package. In other words, csih expects environment variable LOGONSERVER is set, but it is not set on Windows 7 without domain. This issue is resoleved with following simple patch. I hope fixed version of csih will be released. --- cygwin-service-installation-helper.sh.orig 2015-10-28 18:23:35.000000000 +0900 +++ cygwin-service-installation-helper.sh 2018-06-13 22:24:30.353515600 +0900 @@ -2883,6 +2883,7 @@ then # This test succeeds on domain member machines only, not on DCs. if [ "\\\\${COMPUTERNAME,,*}" != "${LOGONSERVER,,*}" \ + -a "${LOGONSERVER}" != "" \ -a "${LOGONSERVER}" != "\\\\MicrosoftAccount" ] then # Lowercase of USERDOMAIN -- Takashi Yano <takashi.yano@nifty.ne.jp> -- 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] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-13 15:29 [bug: csih] Setting privileged rights to cyg_server fails on Windows 7 Takashi Yano @ 2018-06-13 15:44 ` Csaba Raduly 2018-06-13 17:08 ` Takashi Yano 2018-06-13 19:58 ` Corinna Vinschen 1 sibling, 1 reply; 20+ messages in thread From: Csaba Raduly @ 2018-06-13 15:44 UTC (permalink / raw) To: cygwin list Hi Takashi-san, On Wed, Jun 13, 2018 at 3:49 PM, Takashi Yano wrote: > Hi, > > I have found that iu-config of inetutils package fails to set > the privileged rights to cyg_server on Windows 7 if the machine > is not domain member. > > I looked into this problem, and found that this is the problem > of csih package. > > In other words, csih expects environment variable LOGONSERVER > is set, but it is not set on Windows 7 without domain. > > This issue is resoleved with following simple patch. > > I hope fixed version of csih will be released. > > --- cygwin-service-installation-helper.sh.orig 2015-10-28 18:23:35.000000000 +0900 > +++ cygwin-service-installation-helper.sh 2018-06-13 22:24:30.353515600 +0900 > @@ -2883,6 +2883,7 @@ > then > # This test succeeds on domain member machines only, not on DCs. > if [ "\\\\${COMPUTERNAME,,*}" != "${LOGONSERVER,,*}" \ > + -a "${LOGONSERVER}" != "" \ > -a "${LOGONSERVER}" != "\\\\MicrosoftAccount" ] > then > # Lowercase of USERDOMAIN > Won't this break Windows 7 computers which *are* on a domain ? Csaba -- You can get very substantial performance improvements by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler So if you're looking for a completely portable, 100% standards-conformat way to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK) -- 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] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-13 15:44 ` Csaba Raduly @ 2018-06-13 17:08 ` Takashi Yano 0 siblings, 0 replies; 20+ messages in thread From: Takashi Yano @ 2018-06-13 17:08 UTC (permalink / raw) To: cygwin Hi Csaba, Thanks for your comment. On Wed, 13 Jun 2018 16:39:22 +0200 Csaba Raduly wrote: > > --- cygwin-service-installation-helper.sh.orig 2015-10-28 18:23:35.000000000 +0900 > > +++ cygwin-service-installation-helper.sh 2018-06-13 22:24:30.353515600 +0900 > > @@ -2883,6 +2883,7 @@ > > then > > # This test succeeds on domain member machines only, not on DCs. > > if [ "\\\\${COMPUTERNAME,,*}" != "${LOGONSERVER,,*}" \ > > + -a "${LOGONSERVER}" != "" \ > > -a "${LOGONSERVER}" != "\\\\MicrosoftAccount" ] > > then > > # Lowercase of USERDOMAIN > > > > Won't this break Windows 7 computers which *are* on a domain ? I think it will not. This if-statement judges whether the computer is on a domain or not. The judgement should be true when it is on a domain. Windows 7 computers on a domain set the environment LOGONSERVER. So, added line results in true on them. Therefore, the judgment result of the if-statement is the same as in the case without the added line. Windows 7 computer which is not on a domain does not set LOGONSERVER. In this case: "\\\\${COMPUTERNAME,,*}" != "${LOGONSERVER,,*}" --> True "${LOGONSERVER}" != "\\\\MicrosoftAccount" --> True So, the judgement without the added line is "It's on a domain.", which is wrong. The added line avoids this miss judgement. -- Takashi Yano <takashi.yano@nifty.ne.jp> -- 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] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-13 15:29 [bug: csih] Setting privileged rights to cyg_server fails on Windows 7 Takashi Yano 2018-06-13 15:44 ` Csaba Raduly @ 2018-06-13 19:58 ` Corinna Vinschen 2018-06-14 10:30 ` Takashi Yano 1 sibling, 1 reply; 20+ messages in thread From: Corinna Vinschen @ 2018-06-13 19:58 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 848 bytes --] On Jun 13 22:49, Takashi Yano wrote: > Hi, > > I have found that iu-config of inetutils package fails to set > the privileged rights to cyg_server on Windows 7 if the machine > is not domain member. > > I looked into this problem, and found that this is the problem > of csih package. > > In other words, csih expects environment variable LOGONSERVER > is set, but it is not set on Windows 7 without domain. There's something fishy in your environment. The variable LOGONSERVER is always set in Windows NT, at least since NT4. For standalone machines LOGONSERVER is set to "\\<machinename>". You should really try to find out why LOGONSERVER isn't set for you. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-13 19:58 ` Corinna Vinschen @ 2018-06-14 10:30 ` Takashi Yano 2018-06-14 11:31 ` Shaddy Baddah 2018-06-14 12:33 ` Corinna Vinschen 0 siblings, 2 replies; 20+ messages in thread From: Takashi Yano @ 2018-06-14 10:30 UTC (permalink / raw) To: cygwin Hi Corinna, On Wed, 13 Jun 2018 20:14:07 +0200 Corinna Vinschen wrote: > There's something fishy in your environment. The variable LOGONSERVER > is always set in Windows NT, at least since NT4. For standalone > machines LOGONSERVER is set to "\\<machinename>". You should really > try to find out why LOGONSERVER isn't set for you. With your advice, I have found the cause. I usually logon as a user who does not have administrator rights for security reason. This user belong to only "Users" group. When I need administrator rights, I use "Run as administrator" menu to switch to another user who has administrator rights. In this case, LOGONSERVER is not set. If I logoff from the first user account and logon as the second user, LOGONSERVER is set. Moreover, the behaviour above seems to be true not only on Windows 7, but also on Windows 10. I have confirmed that iu-config successfully finishes without the patch I proposed, if I logon as an administrative user instead of using "Run as administrator". Thank you very much. -- Takashi Yano <takashi.yano@nifty.ne.jp> -- 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] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-14 10:30 ` Takashi Yano @ 2018-06-14 11:31 ` Shaddy Baddah 2018-06-14 12:33 ` Corinna Vinschen 1 sibling, 0 replies; 20+ messages in thread From: Shaddy Baddah @ 2018-06-14 11:31 UTC (permalink / raw) To: cygwin Hi, On 14/06/18 07:22, Takashi Yano wrote: > Hi Corinna, > > On Wed, 13 Jun 2018 20:14:07 +0200 > Corinna Vinschen wrote: >> There's something fishy in your environment. The variable LOGONSERVER >> is always set in Windows NT, at least since NT4. For standalone >> machines LOGONSERVER is set to "\\<machinename>". You should really >> try to find out why LOGONSERVER isn't set for you. > > With your advice, I have found the cause. I usually logon as a user > who does not have administrator rights for security reason. This user > belong to only "Users" group. When I need administrator rights, > I use "Run as administrator" menu to switch to another user who > has administrator rights. In this case, LOGONSERVER is not set. > > If I logoff from the first user account and logon as the second user, > LOGONSERVER is set. > > Moreover, the behaviour above seems to be true not only on Windows 7, > but also on Windows 10. > > I have confirmed that iu-config successfully finishes without the > patch I proposed, if I logon as an administrative user instead of > using "Run as administrator". > > Thank you very much. I proposed a similar patch last year, due to the same scenario you mention (elevate to Administrator as a different user): https://cygwin.com/ml/cygwin/2017-01/msg00233.html https://cygwin.com/ml/cygwin/2017-01/msg00283.html I got busy and never followed up on Corinna's concerns. -- Regards, Shaddy -- 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] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-14 10:30 ` Takashi Yano 2018-06-14 11:31 ` Shaddy Baddah @ 2018-06-14 12:33 ` Corinna Vinschen 2018-06-14 13:07 ` Takashi Yano 1 sibling, 1 reply; 20+ messages in thread From: Corinna Vinschen @ 2018-06-14 12:33 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 1399 bytes --] On Jun 14 06:22, Takashi Yano wrote: > Hi Corinna, > > On Wed, 13 Jun 2018 20:14:07 +0200 > Corinna Vinschen wrote: > > There's something fishy in your environment. The variable LOGONSERVER > > is always set in Windows NT, at least since NT4. For standalone > > machines LOGONSERVER is set to "\\<machinename>". You should really > > try to find out why LOGONSERVER isn't set for you. > > With your advice, I have found the cause. I usually logon as a user > who does not have administrator rights for security reason. This user > belong to only "Users" group. When I need administrator rights, > I use "Run as administrator" menu to switch to another user who > has administrator rights. In this case, LOGONSERVER is not set. > > If I logoff from the first user account and logon as the second user, > LOGONSERVER is set. > > Moreover, the behaviour above seems to be true not only on Windows 7, > but also on Windows 10. > > I have confirmed that iu-config successfully finishes without the > patch I proposed, if I logon as an administrative user instead of > using "Run as administrator". > > Thank you very much. Thank you, too. I pushed the patch and will release a new csih package soon. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-14 12:33 ` Corinna Vinschen @ 2018-06-14 13:07 ` Takashi Yano 2018-06-14 17:41 ` Corinna Vinschen 0 siblings, 1 reply; 20+ messages in thread From: Takashi Yano @ 2018-06-14 13:07 UTC (permalink / raw) To: cygwin Hi Corinna, On Thu, 14 Jun 2018 11:16:42 +0200 Corinna Vinschen wrote: > Thank you, too. I pushed the patch and will release a new csih package > soon. I read the discussion in the past pointed by Shaddy. On Thu, 14 Jun 2018 11:29:40 +1000 Shaddy Baddah wrote: > https://cygwin.com/ml/cygwin/2017-01/msg00233.html > https://cygwin.com/ml/cygwin/2017-01/msg00283.html My understanding is that if "Run as administrator" is used, LOGONSERVER is not set even if the machine is on a domain. Therefore it is hard to judge if the machine is on a domain or not when LOGONSERVER is not set. Is this right? Do you have any good idea against this difficulty? -- Takashi Yano <takashi.yano@nifty.ne.jp> -- 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] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-14 13:07 ` Takashi Yano @ 2018-06-14 17:41 ` Corinna Vinschen 2018-06-15 11:46 ` Takashi Yano 0 siblings, 1 reply; 20+ messages in thread From: Corinna Vinschen @ 2018-06-14 17:41 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 1816 bytes --] On Jun 14 19:29, Takashi Yano wrote: > Hi Corinna, > > On Thu, 14 Jun 2018 11:16:42 +0200 > Corinna Vinschen wrote: > > Thank you, too. I pushed the patch and will release a new csih package > > soon. > > I read the discussion in the past pointed by Shaddy. > > On Thu, 14 Jun 2018 11:29:40 +1000 > Shaddy Baddah wrote: > > https://cygwin.com/ml/cygwin/2017-01/msg00233.html > > https://cygwin.com/ml/cygwin/2017-01/msg00283.html > > My understanding is that if "Run as administrator" is used, > LOGONSERVER is not set even if the machine is on a domain. > > Therefore it is hard to judge if the machine is on a domain > or not when LOGONSERVER is not set. Actually, I just tested this on a domain member machine. 1) I'm logged in with an administrative domain account. If I open a shell with "run as administrator", LOGONSERVER is set correctly. 2) I'm logged in with a non-admin domain account. If I open a shell with "run as administrator", enter credentials for the above domain admin account, LOGONSERVER is set correctly. 3) I'm logged in with a non-admin domain account. If I open a shell with "run as administrator", enter credentials for the domain's "Administrator" account, LOGONSERVER is *not* set. 4) I'm logged in with a non-admin domain account. If I open a shell with "run as administrator", enter credentials for the local machine's "Administrator" account, LOGONSERVER is *not* set. I think this is a bug, but looks like we have to live with that. Alternatively we could check for $USERDOMAIN, perhaps. This seems to be set correctly in all scenarios. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-14 17:41 ` Corinna Vinschen @ 2018-06-15 11:46 ` Takashi Yano 2018-06-15 14:39 ` Houder 2018-06-15 15:11 ` Corinna Vinschen 0 siblings, 2 replies; 20+ messages in thread From: Takashi Yano @ 2018-06-15 11:46 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 2142 bytes --] Hi Corinna, On Thu, 14 Jun 2018 13:31:32 +0200 Corinna Vinschen wrote: > 2) I'm logged in with a non-admin domain account. If I open a > shell with "run as administrator", enter credentials for the > above domain admin account, LOGONSERVER is set correctly. In this case, LOGONSERVER is NOT set in my environment. Are you sure of the above result? Anyway, I tested csih-0.9.10-1 released yesterday. First of all, iu-config shows error message at the beginning. *** ERROR: winProductName: C:/cygwin/lib/csih/winProductName.exe: error while loading shared libraries: libssp-0.dll: cannot open shared object file: No such file or directory libssp0 package is installed as follows. However, it seems to provide cygssp-0.dll, but not libssp-0.dll. Is any aother package required? $ cygcheck -c libssp0 Cygwin Package Information Package Version Status libssp0 6.4.0-4 OK Even with the error above, iu-config seems to work. So, I continued testing. Testing was done in the following 8 scenarios. Machine not on a domain: 1.1. Non-admin account + "Run as administrator" for admin 1.2. Admin account Machine on a domain: 2.1. Local non-admin account + "Run as administrator" for local admin 2.2. Local non-admin account + "Run as administrator" for domain admin 2.3. Domain non-admin account + "Run as administrator" for local admin 2.4. Domain non-admin account + "Run as administrator" for domain admin 2.5. Local admin account 2.6. Domain admin account Results are as follows. 1.1: OK 1.2: OK 2.1: Failed 2.2: Failed 2.3: Failed 2.4: Failed 2.5: Failed 2.6: OK In failure cases, error message is: passwd: unknown user cyg_server *** Warning: Setting password expiry for user 'cyg_server' failed! *** Warning: Please check that password never expires or set it to your needs. *** Warning: Expected privileged user 'cyg_server' does not exist. *** Warning: Defaulting to 'SYSTEM' To resolve this problem, I would like to propose a patch attached. I tested the patch for above 8 scenarios, and succeeded for all. Could you please have a look? -- Takashi Yano <takashi.yano@nifty.ne.jp> [-- Attachment #2: csih.patch --] [-- Type: application/octet-stream, Size: 668 bytes --] --- cygwin-service-installation-helper.sh.0.9.10 2018-06-15 06:35:05.223632800 +0900 +++ cygwin-service-installation-helper.sh 2018-06-15 09:49:16.866210900 +0900 @@ -2882,9 +2882,8 @@ if ! csih_use_file_etc "passwd" then # This test succeeds on domain member machines only, not on DCs. - if [ "\\\\${COMPUTERNAME,,*}" != "${LOGONSERVER,,*}" \ - -a "${LOGONSERVER}" != "" \ - -a "${LOGONSERVER}" != "\\\\MicrosoftAccount" ] + if [ "${USERDOMAIN,,*}" != "${COMPUTERNAME,,*}" \ + -o "$(id -un)" == "${USERDOMAIN}+${USERNAME}" ] then # Lowercase of USERDOMAIN csih_PRIVILEGED_USERNAME="${COMPUTERNAME,,*}+${username}" [-- Attachment #3: Type: text/plain, Size: 219 bytes --] -- 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] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-15 11:46 ` Takashi Yano @ 2018-06-15 14:39 ` Houder 2018-06-15 15:11 ` Corinna Vinschen 1 sibling, 0 replies; 20+ messages in thread From: Houder @ 2018-06-15 14:39 UTC (permalink / raw) To: cygwin On Fri, 15 Jun 2018 19:56:35, Takashi Yano wrote: [snip] > First of all, iu-config shows error message at the beginning. > > *** ERROR: winProductName: C:/cygwin/lib/csih/winProductName.exe: error while loading shared libraries: libssp-0.dll: cannot open shared object file: No such file or directory As a side-node: The same applies to getAccountName (which is also part of the csih package). Cannot load both libssp-0.dll and libwinpthread-1.dll Using 64-@@ PATH=$PATH:/usr/x86_64-w64-mingw32/sys-root/mingw/bin cygcheck /usr/lib/csih/getAccountName show this a "PATH" problem. Henri -- 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] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-15 11:46 ` Takashi Yano 2018-06-15 14:39 ` Houder @ 2018-06-15 15:11 ` Corinna Vinschen 2018-06-16 7:14 ` Takashi Yano 1 sibling, 1 reply; 20+ messages in thread From: Corinna Vinschen @ 2018-06-15 15:11 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 1299 bytes --] On Jun 15 19:56, Takashi Yano wrote: > Hi Corinna, > > On Thu, 14 Jun 2018 13:31:32 +0200 > Corinna Vinschen wrote: > > 2) I'm logged in with a non-admin domain account. If I open a > > shell with "run as administrator", enter credentials for the > > above domain admin account, LOGONSERVER is set correctly. > > In this case, LOGONSERVER is NOT set in my environment. > Are you sure of the above result? Yes, I had all results before me when I wrote the mail. This was on W10 Enterprise. > Anyway, I tested csih-0.9.10-1 released yesterday. > > First of all, iu-config shows error message at the beginning. > > *** ERROR: winProductName: C:/cygwin/lib/csih/winProductName.exe: error while loading shared libraries: libssp-0.dll: cannot open shared object file: No such file or directory Apparently only the native tools winProductName and getAccountName are affected by this build problem. It seems that with newer versions of gcc we need to specify --static during the link stage, otherwise we pull in unwanted shared object dependencies. I'm going to push a new version in a bit. Thanks, Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-15 15:11 ` Corinna Vinschen @ 2018-06-16 7:14 ` Takashi Yano 2018-06-16 8:20 ` Takashi Yano 0 siblings, 1 reply; 20+ messages in thread From: Takashi Yano @ 2018-06-16 7:14 UTC (permalink / raw) To: cygwin Hi Corinna, On Fri, 15 Jun 2018 15:34:15 +0200 Corinna Vinschen wrote: > > In this case, LOGONSERVER is NOT set in my environment. > > Are you sure of the above result? > Yes, I had all results before me when I wrote the mail. This was on W10 > Enterprise. My environments are Windows 7 Professional (32bit) and Windows 10 Pro (64bit). In both cases, LOGONSERVER is not set. It is strange that the results are different even in a similar environment. > > *** ERROR: winProductName: C:/cygwin/lib/csih/winProductName.exe: error while loading shared libraries: libssp-0.dll: cannot open shared object file: No such file or directory > Apparently only the native tools winProductName and getAccountName > are affected by this build problem. It seems that with newer versions > of gcc we need to specify --static during the link stage, otherwise > we pull in unwanted shared object dependencies. > > I'm going to push a new version in a bit. I have confirmed this is fixed in csih-0.9.11-1. Thank you. By the way, what do you think of the patch I proposed yesterday? On Fri, 15 Jun 2018 19:56:35 +0900 Takashi Yano wrote: > To resolve this problem, I would like to propose a patch attached. > I tested the patch for above 8 scenarios, and succeeded for all. > Could you please have a look? I will appreciate any comments. -- Takashi Yano <takashi.yano@nifty.ne.jp> -- 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] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-16 7:14 ` Takashi Yano @ 2018-06-16 8:20 ` Takashi Yano 2018-06-16 11:18 ` Corinna Vinschen 0 siblings, 1 reply; 20+ messages in thread From: Takashi Yano @ 2018-06-16 8:20 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 449 bytes --] Hi Corinna, On Sat, 16 Jun 2018 09:49:01 +0900 Takashi Yano wrote: > > To resolve this problem, I would like to propose a patch attached. > > I tested the patch for above 8 scenarios, and succeeded for all. > > Could you please have a look? I have noticed that the username returned by id command can be changed by editing /etc/passwd. Therefore I have made a new patch attached. Please have a look. -- Takashi Yano <takashi.yano@nifty.ne.jp> [-- Attachment #2: csih.patch --] [-- Type: application/octet-stream, Size: 713 bytes --] --- cygwin-service-installation-helper.sh.0.9.10 2018-06-15 06:35:05.223632800 +0900 +++ cygwin-service-installation-helper.sh 2018-06-16 14:25:44.958007800 +0900 @@ -2882,9 +2882,8 @@ if ! csih_use_file_etc "passwd" then # This test succeeds on domain member machines only, not on DCs. - if [ "\\\\${COMPUTERNAME,,*}" != "${LOGONSERVER,,*}" \ - -a "${LOGONSERVER}" != "" \ - -a "${LOGONSERVER}" != "\\\\MicrosoftAccount" ] + if [ "${USERDOMAIN,,*}" != "${COMPUTERNAME,,*}" \ + -o "$(/usr/bin/mkpasswd -c | /usr/bin/awk -F: '{print $1}')" = "${USERDOMAIN}+${USERNAME}" ] then # Lowercase of USERDOMAIN csih_PRIVILEGED_USERNAME="${COMPUTERNAME,,*}+${username}" [-- Attachment #3: Type: text/plain, Size: 219 bytes --] -- 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] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-16 8:20 ` Takashi Yano @ 2018-06-16 11:18 ` Corinna Vinschen 2018-06-16 13:32 ` Takashi Yano 0 siblings, 1 reply; 20+ messages in thread From: Corinna Vinschen @ 2018-06-16 11:18 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 664 bytes --] On Jun 16 14:56, Takashi Yano wrote: > Hi Corinna, > > On Sat, 16 Jun 2018 09:49:01 +0900 > Takashi Yano wrote: > > > To resolve this problem, I would like to propose a patch attached. > > > I tested the patch for above 8 scenarios, and succeeded for all. > > > Could you please have a look? > > I have noticed that the username returned by id command can be changed > by editing /etc/passwd. > > Therefore I have made a new patch attached. Mind to send this as git patch? Thanks, Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-16 11:18 ` Corinna Vinschen @ 2018-06-16 13:32 ` Takashi Yano 2018-06-18 12:14 ` Corinna Vinschen 0 siblings, 1 reply; 20+ messages in thread From: Takashi Yano @ 2018-06-16 13:32 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 222 bytes --] Hi Corinna, On Sat, 16 Jun 2018 10:20:37 +0200 Corinna Vinschen wrote: > Mind to send this as git patch? I have made a patch in "git format-patch" format attached. Thank you. -- Takashi Yano <takashi.yano@nifty.ne.jp> [-- Attachment #2: 0001-Fix-the-test-of-whether-the-computer-is-on-a-domain.patch --] [-- Type: application/octet-stream, Size: 1748 bytes --] From 672beac438c3792dc23965ea62e64fb4fadc3f69 Mon Sep 17 00:00:00 2001 From: Takashi Yano <takashi.yano@nifty.ne.jp> Date: Sat, 16 Jun 2018 19:13:52 +0900 Subject: [PATCH] Fix the test of whether the computer is on a domain. * cygwin-service-installation-helper.sh (csih_select_rivileged_username): In the case logged in as a local user, csih failed to judge to be on a domain even if the computer is on a domain. This is because ${LOGSERVER,,*} has the same value as \\\\${COMPUTERNAME,,*}. The fix is done to use cygwin username returned by mkpasswd command to check it instead. Also, testing has been changed so that USERDOMAIN is used instead of LOGONSERVER because LOGONSERVER may not be set if "Run as administrator" is used. See the post below for more detail. https://cygwin.com/ml/cygwin/2018-06/msg00166.html --- cygwin-service-installation-helper.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cygwin-service-installation-helper.sh b/cygwin-service-installation-helper.sh index abdb0ef..fbdff0d 100755 --- a/cygwin-service-installation-helper.sh +++ b/cygwin-service-installation-helper.sh @@ -2882,9 +2882,8 @@ csih_select_privileged_username() if ! csih_use_file_etc "passwd" then # This test succeeds on domain member machines only, not on DCs. - if [ "\\\\${COMPUTERNAME,,*}" != "${LOGONSERVER,,*}" \ - -a "${LOGONSERVER}" != "" \ - -a "${LOGONSERVER}" != "\\\\MicrosoftAccount" ] + if [ "${USERDOMAIN,,*}" != "${COMPUTERNAME,,*}" \ + -o "$(/usr/bin/mkpasswd -c | /usr/bin/awk -F: '{print $1}')" = "${USERDOMAIN}+${USERNAME}" ] then # Lowercase of USERDOMAIN csih_PRIVILEGED_USERNAME="${COMPUTERNAME,,*}+${username}" -- 2.17.0 [-- Attachment #3: Type: text/plain, Size: 219 bytes --] -- 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] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-16 13:32 ` Takashi Yano @ 2018-06-18 12:14 ` Corinna Vinschen 2018-06-18 12:35 ` Takashi Yano 0 siblings, 1 reply; 20+ messages in thread From: Corinna Vinschen @ 2018-06-18 12:14 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 414 bytes --] On Jun 16 20:13, Takashi Yano wrote: > Hi Corinna, > > On Sat, 16 Jun 2018 10:20:37 +0200 > Corinna Vinschen wrote: > > Mind to send this as git patch? > > I have made a patch in "git format-patch" format attached. Patch pushed. Thanks, Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-18 12:14 ` Corinna Vinschen @ 2018-06-18 12:35 ` Takashi Yano 2018-06-18 17:32 ` Corinna Vinschen 0 siblings, 1 reply; 20+ messages in thread From: Takashi Yano @ 2018-06-18 12:35 UTC (permalink / raw) To: cygwin On Mon, 18 Jun 2018 13:08:25 +0200 Corinna Vinschen wrote: > > I have made a patch in "git format-patch" format attached. > Patch pushed. Thank you. However, I have found a typo in the commit message. I am very sorry. The word which should be "LOGONSERVER" is currently "LOGSERVER" by mistake. - ${LOGSERVER,,*} has the same value as \\\\${COMPUTERNAME,,*}. The + ${LOGONSERVER,,*} has the same value as \\\\${COMPUTERNAME,,*}. The Could you please amend commit message? -- Takashi Yano <takashi.yano@nifty.ne.jp> -- 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] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-18 12:35 ` Takashi Yano @ 2018-06-18 17:32 ` Corinna Vinschen 2018-06-19 1:16 ` Takashi Yano 0 siblings, 1 reply; 20+ messages in thread From: Corinna Vinschen @ 2018-06-18 17:32 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 918 bytes --] On Jun 18 21:14, Takashi Yano wrote: > On Mon, 18 Jun 2018 13:08:25 +0200 > Corinna Vinschen wrote: > > > I have made a patch in "git format-patch" format attached. > > Patch pushed. > > Thank you. > > However, I have found a typo in the commit message. > I am very sorry. > > The word which should be "LOGONSERVER" is currently "LOGSERVER" by mistake. > > - ${LOGSERVER,,*} has the same value as \\\\${COMPUTERNAME,,*}. The > + ${LOGONSERVER,,*} has the same value as \\\\${COMPUTERNAME,,*}. The > > Could you please amend commit message? We're not allowing force pushes to repos on sourceware.com so I can't amend the message. But I don't think it matters, it's a minor type and should be clear from the context. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [bug: csih] Setting privileged rights to cyg_server fails on Windows 7. 2018-06-18 17:32 ` Corinna Vinschen @ 2018-06-19 1:16 ` Takashi Yano 0 siblings, 0 replies; 20+ messages in thread From: Takashi Yano @ 2018-06-19 1:16 UTC (permalink / raw) To: cygwin On Mon, 18 Jun 2018 14:20:37 +0200 Corinna Vinschen wrote: > > Could you please amend commit message? > > We're not allowing force pushes to repos on sourceware.com so I can't > amend the message. But I don't think it matters, it's a minor type > and should be clear from the context. I see. I am sorry I have not checked it enough before posting. -- Takashi Yano <takashi.yano@nifty.ne.jp> -- 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] 20+ messages in thread
end of thread, other threads:[~2018-06-18 12:35 UTC | newest] Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-06-13 15:29 [bug: csih] Setting privileged rights to cyg_server fails on Windows 7 Takashi Yano 2018-06-13 15:44 ` Csaba Raduly 2018-06-13 17:08 ` Takashi Yano 2018-06-13 19:58 ` Corinna Vinschen 2018-06-14 10:30 ` Takashi Yano 2018-06-14 11:31 ` Shaddy Baddah 2018-06-14 12:33 ` Corinna Vinschen 2018-06-14 13:07 ` Takashi Yano 2018-06-14 17:41 ` Corinna Vinschen 2018-06-15 11:46 ` Takashi Yano 2018-06-15 14:39 ` Houder 2018-06-15 15:11 ` Corinna Vinschen 2018-06-16 7:14 ` Takashi Yano 2018-06-16 8:20 ` Takashi Yano 2018-06-16 11:18 ` Corinna Vinschen 2018-06-16 13:32 ` Takashi Yano 2018-06-18 12:14 ` Corinna Vinschen 2018-06-18 12:35 ` Takashi Yano 2018-06-18 17:32 ` Corinna Vinschen 2018-06-19 1:16 ` Takashi Yano
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).