From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5487 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] implement issetugid(2) (v3) Date: Tue, 15 Jul 2014 18:16:57 +0200 Message-ID: <20140715161657.GA9928@port70.net> References: <1405438846-21908-1-git-send-email-bcook@openbsd.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1405441038 31977 80.91.229.3 (15 Jul 2014 16:17:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jul 2014 16:17:18 +0000 (UTC) Cc: musl@lists.openwall.com, beck@openbsd.org, Brent Cook To: Brent Cook Original-X-From: musl-return-5492-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jul 15 18:17:11 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1X75Pi-0002Ui-KA for gllmg-musl@plane.gmane.org; Tue, 15 Jul 2014 18:17:10 +0200 Original-Received: (qmail 32498 invoked by uid 550); 15 Jul 2014 16:17:09 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32489 invoked from network); 15 Jul 2014 16:17:09 -0000 Mail-Followup-To: Brent Cook , musl@lists.openwall.com, beck@openbsd.org, Brent Cook Content-Disposition: inline In-Reply-To: <1405438846-21908-1-git-send-email-bcook@openbsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:5487 Archived-At: * Brent Cook [2014-07-15 15:40:46 +0000]: > --- a/include/unistd.h > +++ b/include/unistd.h > @@ -192,6 +192,10 @@ int euidaccess(const char *, int); > int eaccess(const char *, int); > #endif > > +#ifdef _BSD_SOURCE > +int issetugid(void); > +#endif > + in musl _BSD_SOURCE is a subset of _GNU_SOURCE so it should be used with || defined(_GNU_SOURCE) (_GNU_SOURCE actually means 'everything' instead of 'gnu', and _BSD_SOURCE means 'default', but they are very close to the usual gnu/bsd feature set applications expect there is no distict bsd/gnu/posix behaviour in musl, an interface always behaves the same way if it is visible) otherwise the patch looks good > #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) > #define lseek64 lseek > #define pread64 pread > diff --git a/src/unistd/issetugid.c b/src/unistd/issetugid.c > new file mode 100644 > index 0000000..6ffd930 > --- /dev/null > +++ b/src/unistd/issetugid.c > @@ -0,0 +1,7 @@ > +#include > +#include "libc.h" > + > +int issetugid(void) > +{ > + return libc.secure; > +} > -- > 1.9.1