Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Nov 2020 07:58:19 +0000 (UTC)
From:      Max Khon <fjoe@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r555748 - in head/www/uwsgi: . files
Message-ID:  <202011200758.0AK7wJOB058903@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: fjoe
Date: Fri Nov 20 07:58:19 2020
New Revision: 555748
URL: https://svnweb.freebsd.org/changeset/ports/555748

Log:
  Apply logfile-chown and logfile-chmod options when logfile is rotated.
  
  PR:		250900

Added:
  head/www/uwsgi/files/patch-core-logging.c   (contents, props changed)
Modified:
  head/www/uwsgi/Makefile

Modified: head/www/uwsgi/Makefile
==============================================================================
--- head/www/uwsgi/Makefile	Fri Nov 20 07:23:03 2020	(r555747)
+++ head/www/uwsgi/Makefile	Fri Nov 20 07:58:19 2020	(r555748)
@@ -3,6 +3,7 @@
 
 PORTNAME=	uwsgi
 PORTVERSION=	2.0.19.1
+PORTREVISION=	1
 CATEGORIES=	www python
 MASTER_SITES=	http://projects.unbit.it/downloads/
 

Added: head/www/uwsgi/files/patch-core-logging.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/uwsgi/files/patch-core-logging.c	Fri Nov 20 07:58:19 2020	(r555748)
@@ -0,0 +1,32 @@
+--- core/logging.c.orig	2020-11-06 10:12:49.865752000 +0100
++++ core/logging.c	2020-11-06 10:17:57.825745000 +0100
+@@ -536,13 +536,23 @@
+ 			uwsgi_error_open(logfile);
+ 			exit(1);
+ 		}
+-		else {
+-			if (dup2(fd, log_fd) < 0) {
+-				// this could be lost :(
+-				uwsgi_error("uwsgi_log_do_rotate()/dup2()");
+-				exit(1);
+-			}
++		if (dup2(fd, log_fd) < 0) {
++			// this could be lost :(
++			uwsgi_error("uwsgi_log_do_rotate()/dup2()");
+ 			close(fd);
++			exit(1);
++		}
++		close(fd);
++
++		if (uwsgi.chmod_logfile_value) {
++			if (fchmod(log_fd, uwsgi.chmod_logfile_value)) {
++				uwsgi_error("fchmod()");
++			}
++		}
++		if (uwsgi.logfile_chown) {
++			if (fchown(log_fd, uwsgi.uid, uwsgi.gid)) {
++				uwsgi_error("fchown()");
++			}
+ 		}
+ 	}
+ 	else {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011200758.0AK7wJOB058903>