diff options
author | clsung <clsung@FreeBSD.org> | 2007-10-25 10:18:38 +0800 |
---|---|---|
committer | clsung <clsung@FreeBSD.org> | 2007-10-25 10:18:38 +0800 |
commit | 8bf3693510c67b3538466a898ac47dbe60d7f1a1 (patch) | |
tree | 2dec8c2873a423b6ac612db211ea52340a337547 /security/libprelude | |
parent | a9b859748826d71eb55860731a0eb5a0c6e9f82e (diff) | |
download | freebsd-ports-gnome-8bf3693510c67b3538466a898ac47dbe60d7f1a1.tar.gz freebsd-ports-gnome-8bf3693510c67b3538466a898ac47dbe60d7f1a1.tar.zst freebsd-ports-gnome-8bf3693510c67b3538466a898ac47dbe60d7f1a1.zip |
- Update to 0.9.16
- Added two patches due to some system umask settlement(s).
Added file(s):
- files/patch-prelude-admin__prelude-admin.c
- files/patch-src__prelude-failover.c
Changelog libprelude-0.9.16:
- Implement prelude-admin list [-l] command, which provide the ability to
list existing profile name, permission, registration permission, analyzerID,
and Issuer analyzerid.
- Implement multiple analyzer deletion in prelude-admin.
- Correct printing of IDMEF time field using non local GMT offset.
- Patch to avoid struct typespec redefinition, due to variable mispelling.
This fixes a compilation problem on OpenBSD 3.8.
- Various bug fixes.
PR: ports/117417
Submitted by: maintainer (Robin Gruyters)
Diffstat (limited to 'security/libprelude')
-rw-r--r-- | security/libprelude/Makefile | 2 | ||||
-rw-r--r-- | security/libprelude/distinfo | 6 | ||||
-rw-r--r-- | security/libprelude/files/patch-prelude-admin__prelude-admin.c | 91 | ||||
-rw-r--r-- | security/libprelude/files/patch-src__prelude-failover.c | 98 |
4 files changed, 193 insertions, 4 deletions
diff --git a/security/libprelude/Makefile b/security/libprelude/Makefile index 17e6a8f61be8..d9feaa09928e 100644 --- a/security/libprelude/Makefile +++ b/security/libprelude/Makefile @@ -4,7 +4,7 @@ # $FreeBSD$ PORTNAME= libprelude -PORTVERSION= 0.9.15.2 +PORTVERSION= 0.9.16 CATEGORIES= security MASTER_SITES= http://www.prelude-ids.org/download/releases/ \ http://www.prelude-ids.org/download/releases/old/ diff --git a/security/libprelude/distinfo b/security/libprelude/distinfo index 44de8c4eceed..fcad466429a2 100644 --- a/security/libprelude/distinfo +++ b/security/libprelude/distinfo @@ -1,3 +1,3 @@ -MD5 (libprelude-0.9.15.2.tar.gz) = dab40d05caa8e6d3b9c48e07ad245211 -SHA256 (libprelude-0.9.15.2.tar.gz) = c8013b9f9b572d8301a2c839abd541b4ed00996ed6c0953a5a3ce7a585bf5b4f -SIZE (libprelude-0.9.15.2.tar.gz) = 1949284 +MD5 (libprelude-0.9.16.tar.gz) = d2fa3e77d9104d8ae02e7730e1180f99 +SHA256 (libprelude-0.9.16.tar.gz) = 2831740fdfbfb4299356a091bb883396188c69553dd148cc581eba35d3c00903 +SIZE (libprelude-0.9.16.tar.gz) = 1964830 diff --git a/security/libprelude/files/patch-prelude-admin__prelude-admin.c b/security/libprelude/files/patch-prelude-admin__prelude-admin.c new file mode 100644 index 000000000000..5921bd992fa5 --- /dev/null +++ b/security/libprelude/files/patch-prelude-admin__prelude-admin.c @@ -0,0 +1,91 @@ +--- ./prelude-admin/prelude-admin.c.orig Mon Oct 1 12:47:42 2007 ++++ ./prelude-admin/prelude-admin.c Tue Oct 23 10:16:42 2007 +@@ -69,7 +69,6 @@ + #ifdef WIN32 + # define chown(x, y, z) (0) + # define fchown(x, y, z) (0) +-# define fchmod(x, y) (0) + # define getuid(x) (0) + # define getgid(x) (0) + # define mkdir(x, y) mkdir(x) +@@ -710,10 +709,6 @@ + return -1; + } + +- ret = fchmod(fileno(fd), S_IRUSR|S_IWUSR|S_IRGRP); +- if ( ret < 0 ) +- fprintf(stderr, "error changing '%s' permission: %s.\n", filename, strerror(errno)); +- + ret = fchown(fileno(fd), prelude_client_profile_get_uid(profile), prelude_client_profile_get_gid(profile)); + if ( ret < 0 ) + fprintf(stderr, "error changing '%s' ownership: %s.\n", filename, strerror(errno)); +@@ -752,19 +747,18 @@ + + already_exist = access(filename, F_OK); + +- fd = fopen(filename, (already_exist == 0) ? "r" : "w"); +- if ( ! fd ) { +- fprintf(stderr, "error opening %s: %s.\n", filename, strerror(errno)); ++ ret = open(filename, (already_exist == 0) ? O_RDONLY : O_CREAT|O_WRONLY, S_IRUSR|S_IWUSR|S_IRGRP); ++ if ( ret < 0 ) { ++ fprintf(stderr, "error opening '%s': %s.\n", filename, strerror(errno)); + return -1; + } + +- ret = fchown(fileno(fd), prelude_client_profile_get_uid(profile), prelude_client_profile_get_gid(profile)); +- if ( ret < 0 ) +- fprintf(stderr, "couldn't change %s owner.\n", filename); +- +- ret = fchmod(fileno(fd), S_IRUSR|S_IWUSR|S_IRGRP); +- if ( ret < 0 ) +- fprintf(stderr, "couldn't make ident file readable for all.\n"); ++ fd = fdopen(ret, (already_exist == 0) ? "r" : "w"); ++ if ( ! fd ) { ++ close(ret); ++ fprintf(stderr, "error opening '%s': %s.\n", filename, strerror(errno)); ++ return -1; ++ } + + if ( already_exist == 0 ) { + if ( ! fgets(buf, sizeof(buf), fd) ) { +@@ -945,11 +939,11 @@ + + + +-static int create_directory(prelude_client_profile_t *profile, const char *dirname) ++static int create_directory(prelude_client_profile_t *profile, const char *dirname, int flags) + { + int ret; + +- ret = mkdir(dirname, S_IRWXU|S_IRWXG); ++ ret = mkdir(dirname, flags); + if ( ret < 0 && errno != EEXIST ) { + fprintf(stderr, "error creating directory %s: %s.\n", dirname, strerror(errno)); + return -1; +@@ -977,7 +971,7 @@ + + prelude_client_profile_get_profile_dirname(profile, buf, sizeof(buf)); + +- ret = create_directory(profile, buf); ++ ret = create_directory(profile, buf, S_IRWXU|S_IRGRP|S_IXGRP); + if ( ret < 0 ) { + fprintf(stderr, "error creating directory %s: %s.\n", buf, strerror(errno)); + return -1; +@@ -1000,7 +994,7 @@ + prelude_client_profile_set_analyzerid(profile, *analyzerid); + + prelude_client_profile_get_backup_dirname(profile, buf, sizeof(buf)); +- return create_directory(profile, buf); ++ return create_directory(profile, buf, S_IRWXU|S_IRWXG); + } + + +@@ -2128,6 +2122,8 @@ + #ifndef WIN32 + signal(SIGPIPE, SIG_IGN); + #endif ++ ++ umask(S_IRWXO); + + for ( i = 0; i < sizeof(tbl) / sizeof(*tbl); i++ ) { + if ( strcmp(tbl[i].cmd, argv[1]) != 0 ) diff --git a/security/libprelude/files/patch-src__prelude-failover.c b/security/libprelude/files/patch-src__prelude-failover.c new file mode 100644 index 000000000000..4b4ad3121bc8 --- /dev/null +++ b/security/libprelude/files/patch-src__prelude-failover.c @@ -0,0 +1,98 @@ +--- ./src/prelude-failover.c.orig Thu Aug 30 15:24:30 2007 ++++ ./src/prelude-failover.c Tue Oct 23 10:16:45 2007 +@@ -292,7 +292,7 @@ + struct stat jst, wst; + failover_journal_entry_t jentry; + +- failover->jfd = open(filename, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR); ++ failover->jfd = open(filename, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); + if ( failover->jfd < 0 ) + return prelude_error_verbose(PRELUDE_ERROR_GENERIC, "could not open '%s': %s", filename, strerror(errno)); + +@@ -357,7 +357,7 @@ + { + int ret; + +- *fd = open(filename, flags, S_IRUSR|S_IWUSR); ++ *fd = open(filename, flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); + if ( *fd < 0 ) + return prelude_error_verbose(PRELUDE_ERROR_GENERIC, "error opening '%s': %s", filename, strerror(errno)); + +@@ -498,33 +498,46 @@ + + int prelude_failover_new(prelude_failover_t **out, const char *dirname) + { ++ mode_t mode; + size_t flen; + int ret, wfd, rfd; + char filename[PATH_MAX]; + prelude_failover_t *new; + ++ mode = umask(S_IRWXO); ++ + ret = mkdir(dirname, S_IRWXU|S_IRWXG); +- if ( ret < 0 && errno != EEXIST ) ++ if ( ret < 0 && errno != EEXIST ) { ++ umask(mode); + return prelude_error_verbose(PRELUDE_ERROR_GENERIC, "could not create directory '%s': %s", dirname, strerror(errno)); ++ } + + wfd = get_failover_data_filename_and_fd(dirname, filename, sizeof(filename)); +- if ( wfd < 0 ) ++ if ( wfd < 0 ) { ++ umask(mode); + return wfd; ++ } + + rfd = open(filename, O_RDONLY); + if ( rfd < 0 ) { ++ umask(mode); + close(wfd); + return prelude_error_verbose(PRELUDE_ERROR_GENERIC, "could not open '%s' for reading: %s", filename, strerror(errno)); + } + + new = calloc(1, sizeof(*new)); +- if ( ! new ) ++ if ( ! new ) { ++ umask(mode); ++ close(rfd); ++ close(wfd); + return prelude_error_from_errno(errno); ++ } + + new->jfd = -1; + + ret = prelude_io_new(&new->wfd); + if ( ret < 0 ) { ++ umask(mode); + close(rfd); + close(wfd); + free(new); +@@ -533,6 +546,7 @@ + + ret = prelude_io_new(&new->rfd); + if ( ret < 0 ) { ++ umask(mode); + close(rfd); + close(wfd); + free(new); +@@ -546,16 +560,19 @@ + + ret = snprintf(filename + flen, sizeof(filename) - flen, ".journal"); + if ( ret < 0 || ret >= (sizeof(filename) - flen) ) { ++ umask(mode); + prelude_failover_destroy(new); + return -1; + } + + ret = journal_initialize(new, filename); + if ( ret < 0 ) { ++ umask(mode); + prelude_failover_destroy(new); + return ret; + } + ++ umask(mode); + *out = new; + + return 0; |