[Samba] Patch for bug 14727 / samba > 4.13 in pkgsrc

Andrew Bartlett abartlet at samba.org
Thu Jan 27 20:52:30 UTC 2022


On Thu, 2022-01-27 at 21:30 +0100, Dr. Thomas Orgis via samba wrote:
> Hi,
> 
> since access to Samba's bugzilla seems to be manually curated and I'm
> only a very casual contributor, I hope it's OK for me to discuss
> 
> 	https://bugzilla.samba.org/show_bug.cgi?id=14727
> 
> a bit here. In the process of updating samba4 in pkgsrc from 4.13, 

The Samba and (perhaps more on-topic) samba-technical mailing lists are
a valid forum, but you are most welcome in our bugzilla, I've sent you
an invite.  The barrier to entry to due to spam.

> PS:
> 
> On updating the samba4 package in pkgsrc, I do notice quite a number
> of
> portability patches in there. A notable change is a set of

We would strongly prefer if patches carried in distributors were first
proposed upstream.  Samba in Debian for example has a fairly strong
rule that local patches are not allowed except after they have been put
into Samba master, or if they are truly Debian-specific. 

This helps us in upstream vet the patches and avoids the maintenance
cost because they are autocratically included in new releases. 

(Historically some patches included, and certainly a number that were
proposed for 'portability' in Samba packages would not have been
accepted upstream, and would have caused issues). 

> +       memset(&tp->mutex, 0, sizeof(pthread_mutex_t));
>         ret = pthread_mutex_init(&tp->mutex, NULL);
> 
> with that reason:
> 
> 	On SunOS (OpenSolaris), pthread_mutex_init() expects a zeroed-
> out
> 	mutex data structure
> 
> I'm not sure how current that behaviour is and if one really wants to
> continue to cater for this speciality.
> 
> Hm, and I see something about primary groups for winbind_nss_netbsd …
> and various hacks for the build system which might be special to the
> pkgsrc install method. I'll repeat the winbind one here:
> 
> $NetBSD: patch-nsswitch_winbind__nss__netbsd.c,v 1.2 2020/07/21
> 18:42:25 christos Exp $
> 
> Syntax error fix.
> Add primary group support
> 
> --- nsswitch/winbind_nss_netbsd.c.orig	2020-01-31
> 05:25:36.000000000 -0500
> +++ nsswitch/winbind_nss_netbsd.c	2020-07-21 10:24:19.651265315
> -0400
> @@ -176,6 +176,7 @@
>  {
>  	int		*result	= va_arg(ap, int *);
>  	const char 	*uname	= va_arg(ap, const char *);
> +	gid_t		 agroup	= va_arg(ap, gid_t);
>  	gid_t		*groups	= va_arg(ap, gid_t *);
>  	int		 maxgrp	= va_arg(ap, int);
>  	int		*groupc	= va_arg(ap, int *);
> @@ -185,10 +186,17 @@
>  	};
>  	struct winbindd_response response = {
>  		.length = 0,
> -	}
> +	};
>  	gid_t	*wblistv;
>  	int	wblistc, i, isdup, dupc;
>  
> +	/* add the primary group */
> +	if (*groupc < maxgrp)
> +		groups[*groupc] = agroup;
> +	else
> +		*result = -1;
> +	(*groupc)++;
> +
>  	strncpy(request.data.username, uname,
>  				sizeof(request.data.username) - 1);
>  	i = winbindd_request_response(NULL, WINBINDD_GETGROUPS,
> 
> 
> Does it make sense to push that upstream to Samba? I also see some
> rather trivial header portability fixes. You can check those on
> 
> 	http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/net/samba4/patches/

All packager patches should be proposed upstream for comment in my
view.  We have seen similar things with FreeBSD, you are not alone.

Andrew Bartlett

-- 
Andrew Bartlett (he/him)       https://samba.org/~abartlet/
Samba Team Member (since 2001) https://samba.org
Samba Team Lead, Catalyst IT   https://catalyst.net.nz/services/samba

Samba Development and Support, Catalyst IT - Expert Open Source
Solutions




More information about the samba mailing list