* add support for SUA (interix)
@ 2010-10-27 8:39 mduft
2010-10-27 8:39 ` [PATCH 1/2] add support for the SUA layer (interix; windows) mduft
2010-10-27 8:39 ` [PATCH 2/2] add configure checks for previously created feature flags mduft
0 siblings, 2 replies; 6+ messages in thread
From: mduft @ 2010-10-27 8:39 UTC (permalink / raw)
To: git
second round of review for my patch(es)... i now added the requested configure checks - hope they're ok :)
thanks in advance for another review!
regards, markus
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] add support for the SUA layer (interix; windows)
2010-10-27 8:39 add support for SUA (interix) mduft
@ 2010-10-27 8:39 ` mduft
2010-10-29 0:50 ` Junio C Hamano
2010-10-27 8:39 ` [PATCH 2/2] add configure checks for previously created feature flags mduft
1 sibling, 1 reply; 6+ messages in thread
From: mduft @ 2010-10-27 8:39 UTC (permalink / raw)
To: git; +Cc: Markus Duft
From: Markus Duft <mduft@gentoo.org>
* add required build options to Makefile.
* introduce new NO_INTTYPES_H for systems lacking inttypes; code
includes stdint.h instead, if this is set.
* introduce new NO_SYS_POLL_H for systems lacking sys/poll.h; code
includes poll.h instead, if this is set.
* introduce NO_INITGROUPS. initgroups() call is simply omitted.
Signed-off-by: Markus Duft <mduft@gentoo.org>
---
Makefile | 28 ++++++++++++++++++++++++++++
daemon.c | 6 +++++-
git-compat-util.h | 8 ++++++++
3 files changed, 41 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 1f1ce04..c9d8c9e 100644
--- a/Makefile
+++ b/Makefile
@@ -1096,6 +1096,25 @@ else
endif
X = .exe
endif
+ifeq ($(uname_S),Interix)
+ NO_SYS_POLL_H = YesPlease
+ NO_INTTYPES_H = YesPlease
+ NO_INITGROUPS = YesPlease
+ NO_IPV6 = YesPlease
+ NO_MEMMEM = YesPlease
+ NO_MKDTEMP = YesPlease
+ NO_STRTOUMAX = YesPlease
+ NO_NSEC = YesPlease
+ NO_MKSTEMPS = YesPlease
+ ifeq ($(uname_R),3.5)
+ NO_INET_NTOP = YesPlease
+ NO_INET_PTON = YesPlease
+ endif
+ ifeq ($(uname_R),5.2)
+ NO_INET_NTOP = YesPlease
+ NO_INET_PTON = YesPlease
+ endif
+endif
ifneq (,$(findstring MINGW,$(uname_S)))
pathsep = ;
NO_PREAD = YesPlease
@@ -1360,6 +1379,15 @@ endif
ifdef NO_SYS_SELECT_H
BASIC_CFLAGS += -DNO_SYS_SELECT_H
endif
+ifdef NO_SYS_POLL_H
+ BASIC_CFLAGS += -DNO_SYS_POLL_H
+endif
+ifdef NO_INTTYPES_H
+ BASIC_CFLAGS += -DNO_INTTYPES_H
+endif
+ifdef NO_INITGROUPS
+ BASIC_CFLAGS += -DNO_INITGROUPS
+endif
ifdef NO_MMAP
COMPAT_CFLAGS += -DNO_MMAP
COMPAT_OBJS += compat/mmap.o
diff --git a/daemon.c b/daemon.c
index 9326d3a..d68a31f 100644
--- a/daemon.c
+++ b/daemon.c
@@ -956,7 +956,11 @@ static int serve(char *listen_addr, int listen_port, struct passwd *pass, gid_t
listen_addr, listen_port);
if (pass && gid &&
- (initgroups(pass->pw_name, gid) || setgid (gid) ||
+ (
+#ifndef NO_INITGROUPS
+ initgroups(pass->pw_name, gid) ||
+#endif
+ setgid (gid) ||
setuid(pass->pw_uid)))
die("cannot drop privileges");
diff --git a/git-compat-util.h b/git-compat-util.h
index 2af8d3e..625b2e4 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -106,7 +106,11 @@
#include <utime.h>
#ifndef __MINGW32__
#include <sys/wait.h>
+#ifndef NO_SYS_POLL_H
#include <sys/poll.h>
+#else
+#include <poll.h>
+#endif
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <termios.h>
@@ -118,7 +122,11 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <pwd.h>
+#ifndef NO_INTTYPES_H
#include <inttypes.h>
+#else
+#include <stdint.h>
+#endif
#if defined(__CYGWIN__)
#undef _XOPEN_SOURCE
#include <grp.h>
--
1.7.2.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] add configure checks for previously created feature flags
2010-10-27 8:39 add support for SUA (interix) mduft
2010-10-27 8:39 ` [PATCH 1/2] add support for the SUA layer (interix; windows) mduft
@ 2010-10-27 8:39 ` mduft
1 sibling, 0 replies; 6+ messages in thread
From: mduft @ 2010-10-27 8:39 UTC (permalink / raw)
To: git; +Cc: Markus Duft
From: Markus Duft <mduft@gentoo.org>
*) add check for sys/poll.h. define NO_SYS_POLL_H otherwise.
*) add check for inttypes.h, define NO_INTTYPES_H otherwise.
*) add check for initgroups(), define NO_INITGROUPS otherwise.
Signed-off-by: Markus Duft <mduft@gentoo.org>
---
configure.ac | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index cc55b6d..c5bc9a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -617,6 +617,18 @@ AC_CHECK_HEADER([sys/select.h],
[NO_SYS_SELECT_H=UnfortunatelyYes])
AC_SUBST(NO_SYS_SELECT_H)
#
+# Define NO_SYS_POLL_H if you don't have sys/poll.h
+AC_CHECK_HEADER([sys/poll.h],
+[NO_SYS_POLL_H=],
+[NO_SYS_POLL_H=UnfortunatelyYes])
+AC_SUBST(NO_SYS_POLL_H)
+#
+# Define NO_INTTYPES_H if you don't have inttypes.h
+AC_CHECK_HEADER([inttypes.h],
+[NO_INTTYPES_H=],
+[NO_INTTYPES_H=UnfortunatelyYes])
+AC_SUBST(NO_INTTYPES_H)
+#
# Define OLD_ICONV if your library has an old iconv(), where the second
# (input buffer pointer) parameter is declared with type (const char **).
AC_DEFUN([OLDICONVTEST_SRC], [[
@@ -868,6 +880,12 @@ GIT_CHECK_FUNC(mkstemps,
[NO_MKSTEMPS=YesPlease])
AC_SUBST(NO_MKSTEMPS)
#
+# Define NO_INITGROUPS if you don't have initgroups in the C library.
+GIT_CHECK_FUNC(initgroups,
+[NO_INITGROUPS=],
+[NO_INITGROUPS=YesPlease])
+AC_SUBST(NO_INITGROUPS)
+#
#
# Define NO_MMAP if you want to avoid mmap.
#
--
1.7.2.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] add support for the SUA layer (interix; windows)
2010-10-27 8:39 ` [PATCH 1/2] add support for the SUA layer (interix; windows) mduft
@ 2010-10-29 0:50 ` Junio C Hamano
2010-10-29 5:27 ` Markus Duft
0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2010-10-29 0:50 UTC (permalink / raw)
To: mduft; +Cc: git, Markus Duft, Erik Faye-Lund
mduft@s01en22.salomon.at writes:
> diff --git a/daemon.c b/daemon.c
> index 9326d3a..d68a31f 100644
> --- a/daemon.c
> +++ b/daemon.c
> @@ -956,7 +956,11 @@ static int serve(char *listen_addr, int listen_port, struct passwd *pass, gid_t
> listen_addr, listen_port);
>
> if (pass && gid &&
> - (initgroups(pass->pw_name, gid) || setgid (gid) ||
> + (
> +#ifndef NO_INITGROUPS
> + initgroups(pass->pw_name, gid) ||
> +#endif
> + setgid (gid) ||
> setuid(pass->pw_uid)))
> die("cannot drop privileges");
>
It would be much nicer to do this:
#ifdef NO_INITGROUPS
#define initgroups(x,y) (0) /* nothing */
#endif
near the beginning of the file. That would make life of people who have
changes in flight that would touch the same area of the code a lot easier.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] add support for the SUA layer (interix; windows)
2010-10-29 0:50 ` Junio C Hamano
@ 2010-10-29 5:27 ` Markus Duft
2010-10-29 16:08 ` Junio C Hamano
0 siblings, 1 reply; 6+ messages in thread
From: Markus Duft @ 2010-10-29 5:27 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Erik Faye-Lund
On 10/29/2010 02:50 AM, Junio C Hamano wrote:
> mduft@s01en22.salomon.at writes:
[snip]
>
> It would be much nicer to do this:
>
> #ifdef NO_INITGROUPS
> #define initgroups(x,y) (0) /* nothing */
> #endif
>
> near the beginning of the file. That would make life of people who have
> changes in flight that would touch the same area of the code a lot easier.
ok, i see the point, thanks for your suggestion! I'll change this.
may i ask where i should send v3 of the patch so it gets processed further?
just the ml again, or is there a specific maintainer i should send this to?
regards,
thanks for the help :)
Markus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] add support for the SUA layer (interix; windows)
2010-10-29 5:27 ` Markus Duft
@ 2010-10-29 16:08 ` Junio C Hamano
0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2010-10-29 16:08 UTC (permalink / raw)
To: Markus Duft; +Cc: git, Erik Faye-Lund
Markus Duft <mduft@gentoo.org> writes:
> On 10/29/2010 02:50 AM, Junio C Hamano wrote:
>> mduft@s01en22.salomon.at writes:
> [snip]
>>
>> It would be much nicer to do this:
>>
>> #ifdef NO_INITGROUPS
>> #define initgroups(x,y) (0) /* nothing */
>> #endif
>>
>> near the beginning of the file. That would make life of people who have
>> changes in flight that would touch the same area of the code a lot easier.
>
> ok, i see the point, thanks for your suggestion! I'll change this.
>
> may i ask where i should send v3 of the patch so it gets processed further?
> just the ml again, or is there a specific maintainer i should send this to?
If your v3 will be different from your v2 with only that change, there is
no need to resend. Please check what I queued in 'pu'---it has the above
fix already squashed in.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-10-29 16:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-27 8:39 add support for SUA (interix) mduft
2010-10-27 8:39 ` [PATCH 1/2] add support for the SUA layer (interix; windows) mduft
2010-10-29 0:50 ` Junio C Hamano
2010-10-29 5:27 ` Markus Duft
2010-10-29 16:08 ` Junio C Hamano
2010-10-27 8:39 ` [PATCH 2/2] add configure checks for previously created feature flags mduft
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.