* [gentoo-commits] gentoo-x86 commit in app-admin/logrotate/files: logrotate-3.8.0-atomic-create.patch logrotate-3.8.0-noasprintf.patch
@ 2011-07-18 17:57 Daniel Gryniewicz (dang)
0 siblings, 0 replies; only message in thread
From: Daniel Gryniewicz (dang) @ 2011-07-18 17:57 UTC (permalink / raw
To: gentoo-commits
dang 11/07/18 17:57:34
Modified: logrotate-3.8.0-atomic-create.patch
Added: logrotate-3.8.0-noasprintf.patch
Log:
Fix bug #374407 and bug #374869
(Portage version: 2.2.0_alpha41/cvs/Linux x86_64)
Revision Changes Path
1.2 app-admin/logrotate/files/logrotate-3.8.0-atomic-create.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.8.0-atomic-create.patch?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.8.0-atomic-create.patch?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.8.0-atomic-create.patch?r1=1.1&r2=1.2
Index: logrotate-3.8.0-atomic-create.patch
===================================================================
RCS file: /var/cvsroot/gentoo-x86/app-admin/logrotate/files/logrotate-3.8.0-atomic-create.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- logrotate-3.8.0-atomic-create.patch 6 Jul 2011 22:43:36 -0000 1.1
+++ logrotate-3.8.0-atomic-create.patch 18 Jul 2011 17:57:34 -0000 1.2
@@ -1,18 +1,20 @@
diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN logrotate-3.8.0.orig/logrotate.c logrotate-3.8.0/logrotate.c
--- logrotate-3.8.0.orig/logrotate.c 2011-06-21 04:12:02.000000000 -0400
-+++ logrotate-3.8.0/logrotate.c 2011-07-06 15:07:28.869307029 -0400
-@@ -260,33 +260,48 @@ static int runScript(char *logfn, char *
++++ logrotate-3.8.0/logrotate.c 2011-07-18 11:40:48.775713520 -0400
+@@ -260,33 +260,50 @@ static int runScript(char *logfn, char *
int createOutputFile(char *fileName, int flags, struct stat *sb)
{
int fd;
+ char template[PATH_MAX + 1];
++ char *fname;
+ mode_t umask_value;
+ snprintf(template, PATH_MAX, "%s/logrotate_temp.XXXXXX", ourDirName(fileName));
- fd = open(fileName, (flags | O_EXCL | O_NOFOLLOW),
- (S_IRUSR | S_IWUSR) & sb->st_mode);
+ umask_value = umask(0000);
-+ fd = mkostemp(template, (flags | O_EXCL | O_NOFOLLOW));
++ fname = mktemp(template);
++ fd = open(fname, (flags | O_EXCL | O_NOFOLLOW), (S_IRUSR | S_IWUSR) & sb->st_mode);
+ umask(umask_value);
- if (fd < 0) {
1.1 app-admin/logrotate/files/logrotate-3.8.0-noasprintf.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.8.0-noasprintf.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.8.0-noasprintf.patch?rev=1.1&content-type=text/plain
Index: logrotate-3.8.0-noasprintf.patch
===================================================================
diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN logrotate-3.8.0.orig/config.c logrotate-3.8.0/config.c
--- logrotate-3.8.0.orig/config.c 2011-06-21 04:12:02.000000000 -0400
+++ logrotate-3.8.0/config.c 2011-07-12 13:47:36.274319050 -0400
@@ -41,39 +41,6 @@
#endif
#endif
-#if !defined(asprintf)
-#include <stdarg.h>
-
-int asprintf(char **string_ptr, const char *format, ...)
-{
- va_list arg;
- char *str;
- int size;
- int rv;
-
- va_start(arg, format);
- size = vsnprintf(NULL, 0, format, arg);
- size++;
- va_start(arg, format);
- str = malloc(size);
- if (str == NULL) {
- va_end(arg);
- /*
- * Strictly speaking, GNU asprintf doesn't do this,
- * but the caller isn't checking the return value.
- */
- fprintf(stderr, "failed to allocate memory\\n");
- exit(1);
- }
- rv = vsnprintf(str, size, format, arg);
- va_end(arg);
-
- *string_ptr = str;
- return (rv);
-}
-
-#endif
-
enum {
STATE_DEFAULT = 2,
STATE_SKIP_LINE = 4,
diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN logrotate-3.8.0.orig/logrotate.h logrotate-3.8.0/logrotate.h
--- logrotate-3.8.0.orig/logrotate.h 2011-06-21 04:12:02.000000000 -0400
+++ logrotate-3.8.0/logrotate.h 2011-07-12 13:47:38.949285608 -0400
@@ -66,8 +66,5 @@ extern int numLogs;
extern int debug;
int readAllConfigPaths(const char **paths);
-#if !defined(asprintf)
-int asprintf(char **string_ptr, const char *format, ...);
-#endif
#endif
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-07-18 17:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-18 17:57 [gentoo-commits] gentoo-x86 commit in app-admin/logrotate/files: logrotate-3.8.0-atomic-create.patch logrotate-3.8.0-noasprintf.patch Daniel Gryniewicz (dang)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox