X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=XtK6ci1C+0y4azZy6/OIJI/t7FeyuS7dKXvHre+oOSlddPKq1ONps 0RSOVQMS+Lnida/r14apRU4FEfv334Pycg0CpgRlP3WVCegocO/0yARWQvdMEsLA eM94nhighE0DQzWuetKpEDadM5RPLDWpbXroofgSwiWGrUA0tJVQ5o= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=ALhbatXrXEvBTPAmMOPiHrH7xo4=; b=HnZpoJ98ORkLOWoKfAK3iXov5YzK bTOl37t9E9fVvI2hou/Y/l3odo57CEYOjYJFmS16pJngnlwjFsu+qMAscCCnG8Ds KCPcff3ZBdm6mP3bHu9Uwm+nqOSl6yGn2uUxf0BxY6Xxo42L7g9V3QtUameRMkR2 X77tGICc3GgJc+A= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,TW_MK autolearn=ham version=3.3.1 Date: Mon, 13 May 2013 20:29:52 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Why mkgroup does not list group members? Message-ID: <20130513182952.GO8890@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <5F8AAC04F9616747BC4CC0E803D5907D0AF7961F AT MLBXv04 DOT nih DOT gov> <20130513175045 DOT GJ8890 AT calimero DOT vinschen DOT de> <5F8AAC04F9616747BC4CC0E803D5907D0AF7964F AT MLBXv04 DOT nih DOT gov> <20130513180639 DOT GM8890 AT calimero DOT vinschen DOT de> <5F8AAC04F9616747BC4CC0E803D5907D0AF7968A AT MLBXv04 DOT nih DOT gov> <20130513182319 DOT GN8890 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20130513182319.GN8890@calimero.vinschen.de> User-Agent: Mutt/1.5.21 (2010-09-15) On May 13 20:23, Corinna Vinschen wrote: > On May 13 18:17, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote: > > I may have put it a bit incorrectly, > > > > > In that case, your expectations of the getgrXXX functions are wrong. > > > > but I don't think so. I am looking if a user belongs to a group, > > either as their primary or secondary one. So when using getgrXXX() > > I check to see if a user (whose primary, passwd-supplied, gid does not > > match the gid of the group) is listed as a member. In CYGWIN that does > > not work because the information is missing from the group file. > > Then use Windows functions to fetch the information. This is still > better than to add all users to all groups they belong to. The > passwd/group information is kept in memory. I'm shuddering to think of > the memory requirements if all gr_mem fields are filled in a bigger > company. Instead of using Windows functions you can also use the POSIX function getgrouplist, which is implemented in Cygwin, and which returns a group list containing all groups of a user, provided the group is listed in /etc/groups. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat -- 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