From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin-apps@cygwin.com
Subject: Re: [PATCH setup 0/2] Simplify setting group ownership of installed files
Date: Wed, 13 Jul 2022 17:39:26 +0200 [thread overview]
Message-ID: <b5b7d86b-0fdc-010b-0c21-265745e7eff7@t-online.de> (raw)
In-Reply-To: <20220712125449.14050-1-jon.turney@dronecode.org.uk>
[-- Attachment #1: Type: text/plain, Size: 792 bytes --]
Jon Turney wrote:
> Jon Turney (2):
> Drop group change while running postinstall scripts
> Defer setting group until after All Users/Just For Me is chosen
>
> main.cc | 2 +-
> postinstall.cc | 13 -------------
> root.cc | 5 +++++
> win32.cc | 13 ++-----------
> win32.h | 2 +-
> 5 files changed, 9 insertions(+), 26 deletions(-)
>
Works for me as expected. Primary group of dirs/files of "All Users"
installed files are now local administrator (like before Feb 2012),
including those generated by postinstall scripts (new behavior).
As already mentioned in the '--no-write-registry' thread, "Just me"
installs only work with non-elevated user and '-B' option. Attached is a
temporary patch I used to log changes of root_scope variable.
[-- Attachment #2: log-root_scope-changes.patch --]
[-- Type: text/plain, Size: 962 bytes --]
diff --git a/state.cc b/state.cc
index 111b890..b4e3410 100644
--- a/state.cc
+++ b/state.cc
@@ -24,7 +24,7 @@ int source;
std::string local_dir;
-int root_scope;
+root_scope_holder root_scope;
int root_menu;
int root_desktop;
diff --git a/state.h b/state.h
index b211de3..c561ea5 100644
--- a/state.h
+++ b/state.h
@@ -32,6 +32,7 @@
*/
#include <string>
+#include "LogSingleton.h"
enum attend_mode { attended = 0, unattended, chooseronly };
extern enum attend_mode unattended_mode;
@@ -42,7 +43,22 @@ extern int source;
extern std::string local_dir;
extern int root_text;
-extern int root_scope;
+
+class root_scope_holder
+{
+public:
+ void operator=(int v) {
+ int old = val;
+ val = v;
+ Log(LOG_TIMESTAMP) << "root_scope: " << old << " -> " << v << endLog;
+ }
+ operator int() const { return val; }
+private:
+ int val = 0;
+};
+
+extern root_scope_holder root_scope;
+
extern int root_menu;
extern int root_desktop;
prev parent reply other threads:[~2022-07-13 15:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-12 12:54 Jon Turney
2022-07-12 12:54 ` [PATCH setup 1/2] Drop group change while running postinstall scripts Jon Turney
2022-07-12 12:54 ` [PATCH setup 2/2] Defer setting group until after All Users/Just For Me is chosen Jon Turney
2022-07-13 15:39 ` Christian Franke [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b5b7d86b-0fdc-010b-0c21-265745e7eff7@t-online.de \
--to=christian.franke@t-online.de \
--cc=cygwin-apps@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).