From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.lisp.guile.devel Subject: Re: setgroups Date: Fri, 18 Apr 2003 13:38:46 -0400 Organization: What did you have in mind? A short, blunt, human pyramid? Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <87brz4dagq.fsf@raven.i.defaultvalue.org> <87u1cwcwcq.fsf@raven.i.defaultvalue.org> <874r4w85b6.fsf@zagadka.ping.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1050687705 22518 80.91.224.249 (18 Apr 2003 17:41:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 18 Apr 2003 17:41:45 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Apr 18 19:41:43 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 196Zrq-0005qy-00 for ; Fri, 18 Apr 2003 19:41:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 196ZpN-0002rD-03 for guile-devel@m.gmane.org; Fri, 18 Apr 2003 13:39:09 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 196Zp3-0002pw-00 for guile-devel@gnu.org; Fri, 18 Apr 2003 13:38:49 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 196Zp1-0002p6-00 for guile-devel@gnu.org; Fri, 18 Apr 2003 13:38:48 -0400 Original-Received: from multivac.student.cwru.edu ([129.22.114.26] helo=multivac.cwru.edu) by monty-python.gnu.org with smtp (Exim 4.10.13) id 196Zp1-0002oq-00 for guile-devel@gnu.org; Fri, 18 Apr 2003 13:38:47 -0400 Original-Received: (qmail 19564 invoked by uid 500); 18 Apr 2003 17:39:08 -0000 Original-To: guile-devel@gnu.org In-Reply-To: (Paul Jarc's message of "Fri, 18 Apr 2003 11:37:22 -0400") Mail-Copies-To: nobody Mail-Followup-To: guile-devel@gnu.org Original-Lines: 70 User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2188 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2188 Off-by-one bug in that last version. Index: configure.in =================================================================== RCS file: /cvsroot/guile/guile/guile-core/configure.in,v retrieving revision 1.213 diff -u -r1.213 configure.in --- configure.in 7 Apr 2003 17:31:02 -0000 1.213 +++ configure.in 18 Apr 2003 17:37:56 -0000 @@ -583,7 +583,7 @@ [Define if the system supports Unix-domain (file-domain) sockets.]) fi -AC_CHECK_FUNCS(socketpair getgroups setpwent pause tzset) +AC_CHECK_FUNCS(socketpair getgroups setgroups setpwent pause tzset) AC_CHECK_FUNCS(sethostent gethostent endhostent dnl setnetent getnetent endnetent dnl Index: libguile/posix.c =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/posix.c,v retrieving revision 1.112 diff -u -r1.112 posix.c --- libguile/posix.c 5 Apr 2003 19:10:22 -0000 1.112 +++ libguile/posix.c 18 Apr 2003 17:37:57 -0000 @@ -228,6 +228,41 @@ #undef FUNC_NAME #endif +#ifdef HAVE_SETGROUPS +SCM_DEFINE (scm_setgroups, "setgroups", 1, 0, 0, + (SCM group_vec), + "Set the supplementary group IDs to those found in the vector\n" + "argument.") +#define FUNC_NAME s_scm_setgroups +{ + size_t ngroups; + size_t size; + size_t i; + int result; + GETGROUPS_T *groups; + + SCM_VALIDATE_VECTOR (0, group_vec); + + ngroups = SCM_VECTOR_LENGTH (group_vec); + size = ngroups * sizeof (GETGROUPS_T); + /* XXX - if (ngroups / sizeof (GETGROUPS_T) != size) out-of-range */ + groups = scm_malloc (size); + for(i = ngroups - 1; i >= 0; i--) + { + SCM gid = SCM_VECTOR_REF (group_vec, i); + SCM_VALIDATE_INUM (0, gid); + groups [i] = SCM_INUM (gid); + } + + result = setgroups (ngroups, groups); + free (groups); + if (result < 0) + SCM_SYSERROR; + return SCM_UNSPECIFIED; +} +#undef FUNC_NAME +#endif + #ifdef HAVE_GETPWENT SCM_DEFINE (scm_getpwuid, "getpw", 0, 1, 0, (SCM user), paul _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel