From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3170 invoked by alias); 14 Mar 2014 13:05:11 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 3158 invoked by uid 89); 14 Mar 2014 13:05:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_BL_SPAMCOP_NET,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: smtpback.ht-systems.ru Received: from smtpback.ht-systems.ru (HELO smtpback.ht-systems.ru) (78.110.50.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 14 Mar 2014 13:05:07 +0000 Received: from [91.76.98.252] (helo=darkdragon.lan) by smtp.ht-systems.ru with esmtpa (Exim 4.80.1) (envelope-from ) id 1WORnJ-0007mV-TP; Fri, 14 Mar 2014 17:05:01 +0400 Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Fri, 14 Mar 2014 13:04:46 -0000 Date: Fri, 14 Mar 2014 14:00:00 -0000 From: Andrey Repin Reply-To: cygwin@cygwin.com Message-ID: <1247713652.20140314170446@yandex.ru> To: "PANEL Vincent (CIS/SIN)" , cygwin@cygwin.com Subject: Re: Getting groups you belong to in perl In-Reply-To: <09C6BA32B7B1654B8AB0CAF234F2A1C114E65FAE@A04066.BGC.NET> References: <09C6BA32B7B1654B8AB0CAF234F2A1C114E65CBA@A04066.BGC.NET> <1797360578.20140314023749@yandex.ru> <09C6BA32B7B1654B8AB0CAF234F2A1C114E65FAE@A04066.BGC.NET> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00248.txt.bz2 Greetings, PANEL Vincent (CIS/SIN)! >>> Don't know if this list is more appropriate than the Perl one but my >>> question is actually about porting a Perl script to Cygwin. I need to >>> check if the current user running the script belongs to a pre-defined group. >>> Under *nix, I get the list of users belonging to the group and see if >>> the current user is in this list. >>How exactly you are doing this? (I hope you're not reading it from >>/etc/group, because that file may not exist at all, or contain exactly >>zero relevant >>information.) > I'm using standard perl commands (getgrnam, getlogin, etc... : > http://perldoc.perl.org/5.14.2/functions/getgrnam.html) which are probably > using standard C libraries in the background (I hope). The doc explicitly > says "The $members value returned by getgr*() is a space-separated list of > the login names of the members of the group" but it's always empty under > Cygwin. The functionality you're looking for may(or may not) be available soon(tm). Corinna doing some rework of the core user/group handling as we speak. Check the "Testers needed: New passwd/group handling in Cygwin" thread(s). Do note that in the light of upcoming 1.29 release, snapshots do not contain the code in question. You'd need to rebuild DLL from CVS to get them. >>> Cygwin doesn't allow this way of working. >>Oh... ? > Yes indeed, the standard perl functions work but they always return an empty > list of group members, similar to mkgroup. Makes sense, now, that you explained it. -- WBR, Andrey Repin (anrdaemon@yandex.ru) 14.03.2014, <16:58> Sorry for my terrible english... -- 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