delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/12/27/12:35:05

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 979483850410
Authentication-Results: sourceware.org; dmarc=none (p=none dis=none)
header.from=SystematicSw.ab.ca
Authentication-Results: sourceware.org;
spf=none smtp.mailfrom=brian DOT inglis AT systematicsw DOT ab DOT ca
X-Authority-Analysis: v=2.4 cv=INe8tijG c=1 sm=1 tr=0 ts=5fe8c597
a=kiZT5GMN3KAWqtYcXc+/4Q==:117 a=kiZT5GMN3KAWqtYcXc+/4Q==:17
a=IkcTkHD0fZMA:10 a=uYT-Tk0qkVT609LjNaIA:9 a=QEXdDO2ut3YA:10
Subject: Re: sendmail/setuid
To: cygwin AT cygwin DOT com
References: <87h7ob312r DOT wl-tomas AT basun DOT net>
<d657663f-d91e-3465-5feb-2ce966d18d01 AT SystematicSw DOT ab DOT ca>
<87o8ifti54 DOT wl-tomas AT basun DOT net>
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Organization: Systematic Software
Message-ID: <bffbcad6-c5bd-8607-9ec2-e880b0d3e7e4@SystematicSw.ab.ca>
Date: Sun, 27 Dec 2020 10:34:13 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.6.0
MIME-Version: 1.0
In-Reply-To: <87o8ifti54.wl-tomas@basun.net>
X-CMAE-Envelope: MS4xfBuzrHmittvswB1eWWBmzjTodGAaehMTUK67m3x4ZgZ2NWUKZsYsc0vdPW49bsS3objGhToHhkdQ9lI5ehqV/CkOdTaeL+MD5KUxND09Fp7f7qq1nUsT
Rl6Z0B1vmRLLN0hI+cjo8CYiiAUoIdt+6lun9UN1L1P+pc3mEgDQDkYHaXkqJ7v+nck8V9H7eA8z1xI5bbCogs1OK9surZPl2anWUkySfczPqHWeukTrYR7B
X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,
RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE,
TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Reply-To: cygwin AT cygwin DOT com
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

On 2020-12-27 07:53, Tomas By wrote:
> On Thu, 24 Dec 2020 20:12:17 +0100, Brian Inglis wrote:
>> On 2020-12-24 04:17, Tomas By wrote:
>>> I'm using the Cygwin Sendmail (8.14), and am getting this in the log
>>> file of a program that is supposed to send an email.
>>>
>>> | 451 4.0.0 drop_privileges: setuid(18) failed: Operation not permitted
>>> | RSET
>>> | 250 2.0.0 Reset state
>>>
>>> Does this come from Cygwin? It would be odd if it is from the program.
>>>
>>> There is no user 18. The Windows user id's (I think) are 500, 501,
>>> 1000, 1002, 1003.
>>
>> $ getent passwd 18
>> SYSTEM:*:18:18:U-NT AUTHORITY\SYSTEM,S-1-5-18:/home/SYSTEM:/bin/bash

>>> What is the simplest solution?
>>>
>>> I had it working before I reinstalled, but I tried many things, most
>>> of which I do not want to repeat.

>> Process or program may need to be run elevated with admin privileges,
>> or configured to not require them if that is even possible.
>> The easiest way to do that I have found is to create a Windows task to
>> run elevated (with highest privileges) under user SYSTEM and run a
>> shell invoking a shell script.
>> The task may then start up Cygwin services to run elevated under user
>> SYSTEM or however each is configured.

 > Ok, thanks. I have now got to the point where it works if I start it
 > from a "run as administrator" command shell.
 >
 > I start Sendmail by "sendmail start" in /etc/rc.d/init.d/".
 >
 > What is the easiest way to automate this without interaction? Ideally
 > from a normal account (which is also an "administrator" if that matters).
 >
 > I want to have a .bat file in the Startup folder that starts Sendmail.

The easiest way to do that I have found is to create a Windows task to run 
elevated (with highest privileges) under user SYSTEM and run a shell invoking a 
shell script.

The task is normally run at system startup, and the shell script uses cygrunsrv 
to start all services, but could be run at user login instead I believe, or 
whatever other approach you have to execute scripts as elevated admin processes.

-- 
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.]
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019