[prelude-cvslog] r11016 - libprelude/trunk/prelude-admin
noreply at prelude-ids.org
noreply at prelude-ids.org
Thu Sep 18 12:53:31 CEST 2008
Author: yoann
Date: 2008-09-18 12:53:30 +0200 (Thu, 18 Sep 2008)
New Revision: 11016
Modified:
libprelude/trunk/prelude-admin/prelude-admin.c
libprelude/trunk/prelude-admin/tls-register.c
Log:
Special case Cygwin.
Modified: libprelude/trunk/prelude-admin/prelude-admin.c
===================================================================
--- libprelude/trunk/prelude-admin/prelude-admin.c 2008-09-18 10:46:53 UTC (rev 11015)
+++ libprelude/trunk/prelude-admin/prelude-admin.c 2008-09-18 10:53:30 UTC (rev 11016)
@@ -37,7 +37,7 @@
#include <dirent.h>
#include <signal.h>
-#ifndef WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
# include <pwd.h>
# include <grp.h>
#endif
@@ -67,7 +67,7 @@
#include "tls-register.h"
-#ifdef WIN32
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
# define chown(x, y, z) (0)
# define fchown(x, y, z) (0)
# define getuid(x) (0)
@@ -165,7 +165,7 @@
static void permission_warning(void)
{
-#ifndef WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
fprintf(stderr,
"* WARNING: no --uid or --gid command line options were provided.\n*\n"
@@ -261,7 +261,7 @@
"to communicate with Prelude-Manager instance using this profile.\n\n"
"Options:\n"
-#ifndef WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
" --uid=UID : UID or user used to create the analyzer profile.\n"
" --gid=GID : GID or group used to create the analyzer profile.\n"
#endif
@@ -287,7 +287,7 @@
"registration server. The analyzer profile will be created if it does not exist.\n\n"
"Options:\n"
-#ifndef WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
" --uid=UID : UID or user used to create analyzer profile.\n"
" --gid=GID : GID or group used to create analyzer profile.\n"
#endif
@@ -307,7 +307,7 @@
"This command will create the specified analyzer profile.\n\n"
-#ifndef WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
"Options:\n"
" --uid=UID: UID or user used to create analyzer profile.\n"
" --gid=GID: GID or group used to create analyzer profile.\n"
@@ -326,7 +326,7 @@
"Usage : chown <analyzer profile> <--uid|--gid>\n"
"Example: chown prelude-lml --uid lmluser --gid lmlgroup\n\n"
-#ifndef WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
"Options:\n"
" --uid=UID : UID or user used as new profile permission.\n"
" --gid=GID : GID to group used as new profile permission.\n"
@@ -400,7 +400,7 @@
}
-#ifndef WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
static int set_uid(prelude_option_t *opt, const char *optarg, prelude_string_t *err, void *context)
{
uid_t uid;
@@ -581,7 +581,7 @@
static void setup_permission_options(void)
{
-#ifndef WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
prelude_option_add(parentopt, NULL, PRELUDE_OPTION_TYPE_CLI, 'u', "uid",
NULL, PRELUDE_OPTION_ARGUMENT_REQUIRED, set_uid, NULL);
@@ -2002,7 +2002,7 @@
size_t size;
struct stat st;
struct dirent *dh;
-#ifndef WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
struct group *gr;
struct passwd *pw;
#endif
@@ -2044,7 +2044,7 @@
continue;
}
-#ifndef WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
pw = getpwuid(st.st_uid);
if ( ! pw )
snprintf(uidbuf, sizeof(uidbuf), "%d", (int) st.st_uid);
@@ -2199,7 +2199,7 @@
gnutls_global_init_extra();
#endif
-#ifndef WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
signal(SIGPIPE, SIG_IGN);
#endif
Modified: libprelude/trunk/prelude-admin/tls-register.c
===================================================================
--- libprelude/trunk/prelude-admin/tls-register.c 2008-09-18 10:46:53 UTC (rev 11015)
+++ libprelude/trunk/prelude-admin/tls-register.c 2008-09-18 10:53:30 UTC (rev 11016)
@@ -42,7 +42,7 @@
#include "common.h"
-#ifdef WIN32
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
# define fchown(x, y, z) (0)
#endif
@@ -257,7 +257,7 @@
ssize_t sret;
int fd, ret, flags = 0;
-#ifndef WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
flags |= S_IRGRP;
#endif
More information about the Prelude-cvslog
mailing list