public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: No admin setup questions
@ 2021-02-27  2:44 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  2021-02-27 19:15 ` Adam Dinwoodie
  0 siblings, 1 reply; 4+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] @ 2021-02-27  2:44 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

> Your non-elevated non-admin USER may not have perms to create logs in any of the 
> usual places /var/log/, /tmp/, ./, /

No, I'm the sole user of this installation (that is, all files are "owned" by my user ID, under the Cygwin root)...

The real reason was explained to me in a private response that I am posting below.

Thanks for prepping the procmail postinstall patch -- hopefully, it'll be seen by the package maintainer and adopted into the package, appropriately.

Thanks,
Anton Lavrentiev

-----Original Message-----
From: Adam Dinwoodie <adam@dinwoodie.org> 
Sent: Tuesday, February 23, 2021 2:17 PM
To: Lavrentiev, Anton (NIH/NLM/NCBI) [C] <lavr@ncbi.nlm.nih.gov>
Subject: Re: No admin setup questions

On Tue, 23 Feb 2021 at 16:08, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin wrote:
> Also, I see a lot of messages in the cmd.exe "terminal" window, from where setup was run:  it seems to be logging all actions, including that I was not allowed to open service controller, and missing some rights, what the download and install path are, which packages are being downloaded, extracted and installing.
>
> I do not remember seeing any of those in a "more regular" use (without the -B, when I just click the icon with the program).
>
> Is that some sort of a debugging output left behind?  Just curios, if that's a debug version of the setup ended up on being offered for download inadvertently.

This is expected: the installer will output status to any console that
exists. If you run from a non-administrator cmd/pwsh session and
require Perimeta to escalate privileges, that breaks the link between
the console and the executable, so it can't provide that output. But
if you run from an already-elevated console, or without requiring
admin privileges in the first place, the installer will print details
of its status to the console.


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

* Re: No admin setup questions
  2021-02-27  2:44 No admin setup questions Lavrentiev, Anton (NIH/NLM/NCBI) [C]
@ 2021-02-27 19:15 ` Adam Dinwoodie
  0 siblings, 0 replies; 4+ messages in thread
From: Adam Dinwoodie @ 2021-02-27 19:15 UTC (permalink / raw)
  To: cygwin

On Sat, 27 Feb 2021 at 02:45, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via
Cygwin wrote:
>
> > Your non-elevated non-admin USER may not have perms to create logs in any of the
> > usual places /var/log/, /tmp/, ./, /
>
> No, I'm the sole user of this installation (that is, all files are "owned" by my user ID, under the Cygwin root)...
>
> The real reason was explained to me in a private response that I am posting below.

Apologies for the private response! Clearly my mail client got the
better of me; I'd intended to reply to the list.

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

* Re: No admin setup questions
  2021-02-23 16:08 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
@ 2021-02-23 21:51 ` Brian Inglis
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Inglis @ 2021-02-23 21:51 UTC (permalink / raw)
  To: cygwin

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

On 2021-02-23 09:08, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin wrote:
> I just downloaded the freshest setup.exe from the website to update a very
> old installation on a work PC, and am running it with -B (no admin).
> First thing I noticed is that the front page of the website (Cygwin.com) 
> tells me that the latest Cygwin is 3.1.6, but the setup is downloading
> 3.1.7-1.

Good catch - thanks - patch submitted.

> Also, I see a lot of messages in the cmd.exe "terminal" window, from where 
> setup was run:  it seems to be logging all actions, including that I was not 
> allowed to open service controller, and missing some rights, what the
> download and install path are, which packages are being downloaded, extracted
> and installing.
> I do not remember seeing any of those in a "more regular" use (without the 
> -B, when I just click the icon with the program).

Your non-elevated non-admin USER may not have perms to create logs in any of the 
usual places /var/log/, /tmp/, ./, /

> Is that some sort of a debugging output left behind?  Just curios, if that's 
> a debug version of the setup ended up on being offered for download
> inadvertently.
> Also, procmail fails to post-install (I don't need it, so I don't basically
> care).
> running: C:\cygwin64\bin\bash.exe --norc --noprofile "/etc/postinstall/procmail.sh"
> abnormal exit: exit code=1
Your non-elevated non-admin USER will not have perms to be able to chown to 
SYSTEM, and may not have perms to create directories, install config files, etc. 
required to install services such as procmail which should normally be installed 
or upgraded under an elevated admin USER.

$ head /etc/postinstall/procmail.sh.done
#!/bin/sh

function install_conf {
         if ! [ -s "/$1" ]; then
                 cp -p "/etc/defaults/$1" "/$1"
                 chown SYSTEM "/$1"
                 chmod -x "/$1"
         fi
}
function install_dir {
$ dash -n /etc/postinstall/procmail.sh.done
a/procmail.sh.done: 9: a/procmail.sh.done: Syntax error: "}" unexpected
$ checkbashisms -fnpx /etc/postinstall/procmail.sh.done
possible bashism in /etc/postinstall/procmail.sh.done line 3 ('function' is 
useless):
function install_conf {
possible bashism in /etc/postinstall/procmail.sh.done line 10 ('function' is 
useless):
function install_dir {

Script /etc/postinstall/procmail.sh is non-POSIX, non-portable, will not run 
under dash or another POSIX shell, only if sh is bash as installed by Cygwin or 
something similar; to be safe, explicit standard binary paths should be 
hardcoded and precautions taken, just in case a proper PATH is not yet set, the 
script is not run under native Cygwin, or not installed for all users under an 
elevated admin USER, similar to the attached patch.

The postinstall script would be better rewritten to take account of these 
conditions and use the install utility designed to do all this instead of 
duplicating it in functions.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

[-- Attachment #2: procmail.sh.patch --]
[-- Type: text/plain, Size: 886 bytes --]

diff a/procmail.sh b/procmail.sh
--- a/procmail.sh	2015-05-02 15:47:51.000000000 -0600
+++ b/procmail.sh	2021-02-23 14:36:11.615337500 -0700
@@ -1,22 +1,24 @@
 #!/bin/sh
 
-function install_conf {
+install_conf () {
 	if ! [ -s "/$1" ]; then
-		cp -p "/etc/defaults/$1" "/$1"
-		chown SYSTEM "/$1"
-		chmod -x "/$1"
+		/bin/cp -p "/etc/defaults/$1" "/$1"
+		[ -n "$CYGWINFORALL" ] && /bin/chown $root "/$1"
+		/bin/chmod a-x "/$1"
 	fi
 }
-function install_dir {
+install_dir () {
 	if ! [ -d "$1" ]; then
-		mkdir -p "$1"
-		chown SYSTEM "$1"
+		/bin/mkdir -p "$1"
+		[ -n "$CYGWINFORALL" ] && /bin/chown $root "$1"
 	fi
 }
 
+[ $(uname -o) = Cygwin ] && root=SYSTEM || root=root
+
 install_dir /var/spool/mail
 install_conf etc/aliases
 
-chown SYSTEM /usr/bin/procmail.exe
-chown SYSTEM /usr/bin/lockfile.exe
+/bin/chown $root /usr/bin/procmail
+/bin/chown $root /usr/bin/lockfile
 

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

* No admin setup questions
@ 2021-02-23 16:08 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  2021-02-23 21:51 ` Brian Inglis
  0 siblings, 1 reply; 4+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] @ 2021-02-23 16:08 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

Hi All,

I just downloaded the freshest setup.exe from the website to update a very old installation on a work PC, and am running it with -B (no admin).

First thing I noticed is that the front page of the website (Cygwin.com) tells me that the latest Cygwin is 3.1.6, but the setup is downloading 3.1.7-1.

Also, I see a lot of messages in the cmd.exe "terminal" window, from where setup was run:  it seems to be logging all actions, including that I was not allowed to open service controller, and missing some rights, what the download and install path are, which packages are being downloaded, extracted and installing.

I do not remember seeing any of those in a "more regular" use (without the -B, when I just click the icon with the program).

Is that some sort of a debugging output left behind?  Just curios, if that's a debug version of the setup ended up on being offered for download inadvertently.

Also, procmail fails to post-install (I don't need it, so I don't basically care).

running: C:\cygwin64\bin\bash.exe --norc --noprofile "/etc/postinstall/procmail.sh"
abnormal exit: exit code=1

Thanks,
Anton

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

end of thread, other threads:[~2021-02-27 19:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-27  2:44 No admin setup questions Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2021-02-27 19:15 ` Adam Dinwoodie
  -- strict thread matches above, loose matches on Subject: below --
2021-02-23 16:08 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2021-02-23 21:51 ` Brian Inglis

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).