From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) by sourceware.org (Postfix) with ESMTPS id B38983858D20 for ; Fri, 27 Jan 2023 19:39:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B38983858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=Shaw.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=shaw.ca Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id LQq1pV3y1c9C4LUZApzL9J; Fri, 27 Jan 2023 19:39:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=shaw.ca; s=s20180605; t=1674848356; bh=8DyinH8IAeSajhkr/Ha65uGPpaMLxcu7i0uPR6IsA6s=; h=Date:Reply-To:Subject:To:References:From:In-Reply-To; b=jN9u5m2l44fBHx3iYXeuAEXNZIJbZybERSC6QGUr2xdc0AO7EKvNfSLGt7J9fjPdV G91X3ltCBx1ixpAajxQ/Y8VcD6NyOw0Wt3FKgnZmQgod71E2bfujl6UaFwOrARgNQE Vhi+MNkju/soxau4JKn+RvP2XjH+l0rr8CLK6fijG1zScFTCg+Qm7X8AFxuFBzX9Ds Spd/NXiP48qBWQnsoq+aVc+mmZ2CUNc8dWXin9QiBcSWFVKuXSIB9xvKK5F4otQEa6 adaSLc7e9WDqy7mGBR6T4prNStlyGHqyUwWPBnO3FTw3sgc3GznBMkaAJSsk2gZTmf F8fIpvry5O7Ag== Received: from [10.0.0.5] ([184.64.124.72]) by cmsmtp with ESMTP id LUZ9pgxiyyAOeLUZ9pssn6; Fri, 27 Jan 2023 19:39:16 +0000 X-Authority-Analysis: v=2.4 cv=e5oV9Il/ c=1 sm=1 tr=0 ts=63d42864 a=oHm12aVswOWz6TMtn9zYKg==:117 a=oHm12aVswOWz6TMtn9zYKg==:17 a=IkcTkHD0fZMA:10 a=b5rm1lYdzqVmvSi9MQUA:9 a=QEXdDO2ut3YA:10 Message-ID: <3bafc985-e382-5b31-bca5-3556ca6e4e40@Shaw.ca> Date: Fri, 27 Jan 2023 12:39:15 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Reply-To: cygwin@cygwin.com Subject: Re: BUG: Log on Scheduled Task invisible/empty window blocks input Content-Language: en-CA To: cygwin@cygwin.com References: From: Brian Inglis Organization: Inglis In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfOMZ3d8RJ5ETjswpc1Lf04GLpm6th+WLOriLv08q4oaFYVPtLCcJmeC6yRsZYnua1v8/xA0br/p3zgWPK6m7kWAPPxdw05+dm3Fqj6YB/lpU63jHaezR DcOeJEtrp7Dmn+NI8QIE9z1322AyQPfPGbg3OjDe64c9aFkHh3Q8LFWJ9fxeZHtte+2sOsTnRxwUkg== X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-01-26 19:43, Ross Patterson via Cygwin wrote: > TL;DR: I needed to run a Cygwin process at user log on with highest > privileges to perform some operations that are not allowed any other > way without requiring a UAC prompt. This results in a window without > any border, close button or any other decoration that is most often > invisible/transparent, sometimes opaque white, and most rarely with > black unusable left/bottom scroll bars. The window is always on top, > accepts no inputs at all, and blocks input to windows below. The only > way to get rid of the windows is to kill the scheduled task process or > trigger a UAC prompt. More details below. > > It seems like this probably is a bug, so feel free to consider this a > bug report, but I'm mostly writing this up so others can find it and > my workarounds and hopefully save them some hassle and I probably > won't be doing much followup. Both the edge cases and observed > results are numerous and each test iteration is time consuming, but > I've done my best to get as complete coverage as I could and to > tightly control conditions for reliable results. > > There are a few things I want to do through Cygwin that require > privileges that cannot be attained through a service or a scheduled > task with an "At startup" trigger. The only way I've found to run the > process with the required privileges without a UAC prompt and without > disabling UAC completely is a scheduled task with these settings: > > 1. "General" tab: "Run only when user is logged on" = SELECTED > 2. "General" tab: "Run with highest priveleges" = CHECKED > 3. "Triggers" tab: Add an "At log on" trigger for a "Specific user" > > As such I've not tested this behavior with different settings on the > "General" tab. I use scheduled tasks with actions running scripts from /usr/local/bin/ under dash (or bash if required) native path with WD /var/log/ native path e.g. %CYGWIN_ROOT%\bin\dash /usr/local/bin/....sh WD %CYGWIN_ROOT%\var\log with various options (mainly user SYSTEM, logged in or not, highest privileges), and triggers. I never see any windows appearing as the scripts log everything under /var/log/. The scripts run as tasks start and stop Cygwin services, init and run smart reporting, clean up cron job remnants before smart reporting, terminate all processes before running setup. For normal scripts and schedules, I use cron job commands or scripts which log everything under /var/log/. -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry