On Sat, Apr 06, 2013 at 09:25:28AM -0700, [email protected] wrote:
> "The non-interactive version ("make upgrade") needs the
> /etc/postfix/main.cf file from a previous installation.
It works just fine without one. If you don't want to build a package,
but want non-interactive installation, that's what "make upgrade" does.
I am attaching a patch for "MacOSX", where a bare-metal "make
upgrade" with no main.cf fails, because Apple defines "postfix" as
a nickname for "_postfix" and "postdrop" as a nickname for "_postdrop",
so with default compile-time settings the Postfix installer aborts
because its uid appears to be shared.
--
Viktor.
--- a/makedefs
+++ b/makedefs
@@ -461,6 +461,10 @@ ReliantUNIX-?.5.43) SYSTYPE=ReliantUnix543
# Use the native compiler by default
: ${CC=cc}
CCARGS="$CCARGS \$(WARN)"
+ # Is the "postfix" user a built-in nickame for "_postfix"
+ case $(id -nu postfix 2>/dev/null) in
+ _postfix) CCARGS="$CCARGS -D_PREPEND_OWNER_SGID";;
+ esac
# Darwin > 1.3 uses awk and flat_namespace
case $RELEASE in
1.[0-3]) AWK=gawk;;
--- a/proto/INSTALL.html
+++ b/proto/INSTALL.html
@@ -337,6 +337,12 @@ default</th> </tr>
<tr> <td>DEF_SENDMAIL_PATH</td> <td>sendmail_path</td>
<td>/usr/sbin/sendmail</td> </tr>
+<tr> <td>DEF_MAIL_OWNER</td> <td>mail_owner</td>
+<td>postfix</td> </tr>
+
+<tr> <td>DEF_SGID_GROUP</td> <td>setgid_group</td>
+<td>postdrop</td> </tr>
+
</table>
</blockquote>
--- a/src/global/mail_params.h
+++ b/src/global/mail_params.h
@@ -61,13 +61,17 @@ extern char *var_empty_addr;
* the rights to be used when running external commands.
*/
#define VAR_MAIL_OWNER "mail_owner"
+#ifndef DEF_MAIL_OWNER
#define DEF_MAIL_OWNER "postfix"
+#endif
extern char *var_mail_owner;
extern uid_t var_owner_uid;
extern gid_t var_owner_gid;
#define VAR_SGID_GROUP "setgid_group"
+#ifndef DEF_SGID_GROUP
#define DEF_SGID_GROUP "postdrop"
+#endif
extern char *var_sgid_group;
extern gid_t var_sgid_gid;
--- a/src/util/sys_defs.h
+++ b/src/util/sys_defs.h
@@ -260,6 +260,14 @@
#ifndef NO_POSIX_GETPW_R
# define HAVE_POSIX_GETPW_R
#endif
+#ifdef _PREPEND_OWNER_SGID
+#ifndef DEF_MAIL_OWNER
+#define DEF_MAIL_OWNER "_postfix"
+#endif
+#ifndef DEF_SGID_GROUP
+#define DEF_SGID_GROUP "_postdrop"
+#endif
+#endif
#endif