{"thread":{"id":"25557","subject":"add support for SUA (interix)","startedAt":"2010-10-27T08:39:51Z","lastAt":"2010-10-29T16:08:32Z","messageCount":6,"participants":["mduft@s01en22.salomon.at","Junio C Hamano","Markus Duft"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"154481","messageId":"1288168793-11159-1-git-send-email-markus.duft@salomon.at","threadId":"25557","inReplyTo":null,"subject":"add support for SUA (interix)","fromName":"","fromEmail":"mduft@s01en22.salomon.at","sentAt":"2010-10-27T08:39:51Z","receivedAt":"2010-10-27T08:39:51Z","isPatch":false,"sender":{"key":"mduft@s01en22.salomon.at","avatar":null},"body":"\nsecond round of review for my patch(es)... i now added the requested configure checks - hope they're ok :)\n\nthanks in advance for another review!\n\nregards, markus\n"},{"id":"154482","messageId":"1288168793-11159-2-git-send-email-markus.duft@salomon.at","threadId":"25557","inReplyTo":"1288168793-11159-1-git-send-email-markus.duft@salomon.at","subject":"[PATCH 1/2] add support for the SUA layer (interix; windows)","fromName":"","fromEmail":"mduft@s01en22.salomon.at","sentAt":"2010-10-27T08:39:52Z","receivedAt":"2010-10-27T08:39:52Z","isPatch":true,"sender":{"key":"mduft@s01en22.salomon.at","avatar":null},"body":"From: Markus Duft <mduft@gentoo.org>\n\n* add required build options to Makefile.\n* introduce new NO_INTTYPES_H for systems lacking inttypes; code\n  includes stdint.h instead, if this is set.\n* introduce new NO_SYS_POLL_H for systems lacking sys/poll.h; code\n  includes poll.h instead, if this is set.\n* introduce NO_INITGROUPS. initgroups() call is simply omitted.\n\nSigned-off-by: Markus Duft <mduft@gentoo.org>\n---\n Makefile          |   28 ++++++++++++++++++++++++++++\n daemon.c          |    6 +++++-\n git-compat-util.h |    8 ++++++++\n 3 files changed, 41 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 1f1ce04..c9d8c9e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1096,6 +1096,25 @@ else\n endif\n \tX = .exe\n endif\n+ifeq ($(uname_S),Interix)\n+\tNO_SYS_POLL_H = YesPlease\n+\tNO_INTTYPES_H = YesPlease\n+\tNO_INITGROUPS = YesPlease\n+\tNO_IPV6 = YesPlease\n+\tNO_MEMMEM = YesPlease\n+\tNO_MKDTEMP = YesPlease\n+\tNO_STRTOUMAX = YesPlease\n+\tNO_NSEC = YesPlease\n+\tNO_MKSTEMPS = YesPlease\n+\tifeq ($(uname_R),3.5)\n+\t\tNO_INET_NTOP = YesPlease\n+\t\tNO_INET_PTON = YesPlease\n+\tendif\n+\tifeq ($(uname_R),5.2)\n+\t\tNO_INET_NTOP = YesPlease\n+\t\tNO_INET_PTON = YesPlease\n+\tendif\n+endif\n ifneq (,$(findstring MINGW,$(uname_S)))\n \tpathsep = ;\n \tNO_PREAD = YesPlease\n@@ -1360,6 +1379,15 @@ endif\n ifdef NO_SYS_SELECT_H\n \tBASIC_CFLAGS += -DNO_SYS_SELECT_H\n endif\n+ifdef NO_SYS_POLL_H\n+\tBASIC_CFLAGS += -DNO_SYS_POLL_H\n+endif\n+ifdef NO_INTTYPES_H\n+\tBASIC_CFLAGS += -DNO_INTTYPES_H\n+endif\n+ifdef NO_INITGROUPS\n+\tBASIC_CFLAGS += -DNO_INITGROUPS\n+endif\n ifdef NO_MMAP\n \tCOMPAT_CFLAGS += -DNO_MMAP\n \tCOMPAT_OBJS += compat/mmap.o\ndiff --git a/daemon.c b/daemon.c\nindex 9326d3a..d68a31f 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -956,7 +956,11 @@ static int serve(char *listen_addr, int listen_port, struct passwd *pass, gid_t\n \t\t    listen_addr, listen_port);\n \n \tif (pass && gid &&\n-\t    (initgroups(pass->pw_name, gid) || setgid (gid) ||\n+\t    (\n+#ifndef NO_INITGROUPS\n+\t\t    initgroups(pass->pw_name, gid) || \n+#endif\n+\t     setgid (gid) ||\n \t     setuid(pass->pw_uid)))\n \t\tdie(\"cannot drop privileges\");\n \ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 2af8d3e..625b2e4 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -106,7 +106,11 @@\n #include <utime.h>\n #ifndef __MINGW32__\n #include <sys/wait.h>\n+#ifndef NO_SYS_POLL_H\n #include <sys/poll.h>\n+#else\n+#include <poll.h>\n+#endif\n #include <sys/socket.h>\n #include <sys/ioctl.h>\n #include <termios.h>\n@@ -118,7 +122,11 @@\n #include <arpa/inet.h>\n #include <netdb.h>\n #include <pwd.h>\n+#ifndef NO_INTTYPES_H\n #include <inttypes.h>\n+#else\n+#include <stdint.h>\n+#endif\n #if defined(__CYGWIN__)\n #undef _XOPEN_SOURCE\n #include <grp.h>\n-- \n1.7.2.2\n"},{"id":"154483","messageId":"1288168793-11159-3-git-send-email-markus.duft@salomon.at","threadId":"25557","inReplyTo":"1288168793-11159-1-git-send-email-markus.duft@salomon.at","subject":"[PATCH 2/2] add configure checks for previously created feature flags","fromName":"","fromEmail":"mduft@s01en22.salomon.at","sentAt":"2010-10-27T08:39:53Z","receivedAt":"2010-10-27T08:39:53Z","isPatch":true,"sender":{"key":"mduft@s01en22.salomon.at","avatar":null},"body":"From: Markus Duft <mduft@gentoo.org>\n\n *) add check for sys/poll.h. define NO_SYS_POLL_H otherwise.\n *) add check for inttypes.h, define NO_INTTYPES_H otherwise.\n *) add check for initgroups(), define NO_INITGROUPS otherwise.\n\nSigned-off-by: Markus Duft <mduft@gentoo.org>\n---\n configure.ac |   18 ++++++++++++++++++\n 1 files changed, 18 insertions(+), 0 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex cc55b6d..c5bc9a0 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -617,6 +617,18 @@ AC_CHECK_HEADER([sys/select.h],\n [NO_SYS_SELECT_H=UnfortunatelyYes])\n AC_SUBST(NO_SYS_SELECT_H)\n #\n+# Define NO_SYS_POLL_H if you don't have sys/poll.h\n+AC_CHECK_HEADER([sys/poll.h],\n+[NO_SYS_POLL_H=],\n+[NO_SYS_POLL_H=UnfortunatelyYes])\n+AC_SUBST(NO_SYS_POLL_H)\n+#\n+# Define NO_INTTYPES_H if you don't have inttypes.h\n+AC_CHECK_HEADER([inttypes.h],\n+[NO_INTTYPES_H=],\n+[NO_INTTYPES_H=UnfortunatelyYes])\n+AC_SUBST(NO_INTTYPES_H)\n+#\n # Define OLD_ICONV if your library has an old iconv(), where the second\n # (input buffer pointer) parameter is declared with type (const char **).\n AC_DEFUN([OLDICONVTEST_SRC], [[\n@@ -868,6 +880,12 @@ GIT_CHECK_FUNC(mkstemps,\n [NO_MKSTEMPS=YesPlease])\n AC_SUBST(NO_MKSTEMPS)\n #\n+# Define NO_INITGROUPS if you don't have initgroups in the C library.\n+GIT_CHECK_FUNC(initgroups,\n+[NO_INITGROUPS=],\n+[NO_INITGROUPS=YesPlease])\n+AC_SUBST(NO_INITGROUPS)\n+#\n #\n # Define NO_MMAP if you want to avoid mmap.\n #\n-- \n1.7.2.2\n"},{"id":"154708","messageId":"7veib99608.fsf@alter.siamese.dyndns.org","threadId":"25557","inReplyTo":"1288168793-11159-2-git-send-email-markus.duft@salomon.at","subject":"Re: [PATCH 1/2] add support for the SUA layer (interix; windows)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-29T00:50:31Z","receivedAt":"2010-10-29T00:50:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"mduft@s01en22.salomon.at writes:\n\n> diff --git a/daemon.c b/daemon.c\n> index 9326d3a..d68a31f 100644\n> --- a/daemon.c\n> +++ b/daemon.c\n> @@ -956,7 +956,11 @@ static int serve(char *listen_addr, int listen_port, struct passwd *pass, gid_t\n>  \t\t    listen_addr, listen_port);\n>  \n>  \tif (pass && gid &&\n> -\t    (initgroups(pass->pw_name, gid) || setgid (gid) ||\n> +\t    (\n> +#ifndef NO_INITGROUPS\n> +\t\t    initgroups(pass->pw_name, gid) || \n> +#endif\n> +\t     setgid (gid) ||\n>  \t     setuid(pass->pw_uid)))\n>  \t\tdie(\"cannot drop privileges\");\n>  \n\nIt would be much nicer to do this:\n\n        #ifdef NO_INITGROUPS\n        #define initgroups(x,y) (0) /* nothing */\n        #endif\n\nnear the beginning of the file.  That would make life of people who have\nchanges in flight that would touch the same area of the code a lot easier.\n"},{"id":"154717","messageId":"4CCA5B50.2040208@gentoo.org","threadId":"25557","inReplyTo":"7veib99608.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/2] add support for the SUA layer (interix; windows)","fromName":"Markus Duft","fromEmail":"mduft@gentoo.org","sentAt":"2010-10-29T05:27:44Z","receivedAt":"2010-10-29T05:27:44Z","isPatch":true,"sender":{"key":"mduft@gentoo.org","avatar":null},"body":"On 10/29/2010 02:50 AM, Junio C Hamano wrote:\n> mduft@s01en22.salomon.at writes:\n[snip]\n> \n> It would be much nicer to do this:\n> \n>         #ifdef NO_INITGROUPS\n>         #define initgroups(x,y) (0) /* nothing */\n>         #endif\n> \n> near the beginning of the file.  That would make life of people who have\n> changes in flight that would touch the same area of the code a lot easier.\n\nok, i see the point, thanks for your suggestion! I'll change this.\n\nmay i ask where i should send v3 of the patch so it gets processed further?\njust the ml again, or is there a specific maintainer i should send this to?\n\nregards,\nthanks for the help :)\nMarkus\n"},{"id":"154788","messageId":"7vsjzp6kxr.fsf@alter.siamese.dyndns.org","threadId":"25557","inReplyTo":"4CCA5B50.2040208@gentoo.org","subject":"Re: [PATCH 1/2] add support for the SUA layer (interix; windows)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-29T16:08:32Z","receivedAt":"2010-10-29T16:08:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Markus Duft <mduft@gentoo.org> writes:\n\n> On 10/29/2010 02:50 AM, Junio C Hamano wrote:\n>> mduft@s01en22.salomon.at writes:\n> [snip]\n>> \n>> It would be much nicer to do this:\n>> \n>>         #ifdef NO_INITGROUPS\n>>         #define initgroups(x,y) (0) /* nothing */\n>>         #endif\n>> \n>> near the beginning of the file.  That would make life of people who have\n>> changes in flight that would touch the same area of the code a lot easier.\n>\n> ok, i see the point, thanks for your suggestion! I'll change this.\n>\n> may i ask where i should send v3 of the patch so it gets processed further?\n> just the ml again, or is there a specific maintainer i should send this to?\n\nIf your v3 will be different from your v2 with only that change, there is\nno need to resend.  Please check what I queued in 'pu'---it has the above\nfix already squashed in.\n"}]}