Quoting Peter Eisentraut ([EMAIL PROTECTED]):
> Christian Perrier wrote:
> > Do we do it silently without prompting? This is, strictly speaking,
> > non policy compliant....but who wants a package that will panic after
> > an upgrade?
> 
> You might be thinking of conffiles, but smb.conf is not a conffile.

Well, sure, but messing up with it without prior thinking is not
something I would do easily..:-)

We all know that the smb.conf file is the core of samba, so
"philosophically speaking" we should touch it as less as possible.

> 
> I propose the following patch:
> 
> Index: samba-common.postinst
> ===================================================================
> --- samba-common.postinst       (Revision 1121)
> +++ samba-common.postinst       (Arbeitskopie)
> @@ -136,4 +136,8 @@
> 
>  db_stop
> 
> +if [ -n "$2" ] && dpkg --compare-versions "$2" lt 3.0.23b-2; then
> +       sed -i -e 's/^\([[:space:]]*passdb backend = 
> [[:alpha:]][[:alpha:]]*\) guest$/\1/' /etc/samba/smb.conf
> +fi
> +
>  #DEBHELPER#


In first reading, the patch seems fair by me. Maybe handle the case
where users could have multiple spaces around the equal sign:

 sed -i -e 's/^\([[:space:]]*passdb 
backend[[:space:]]*=[[:space:]]*[[:alpha:]][[:alpha:]]*\) guest$/\1/' 
/etc/samba/smb.conf

> Btw., is there anything wrong with using "sed -i"?  The rest of the
> postinst seems to go out of its way to handle sed with manual temp files.

I don't have any advice here. Not using temp files is cleaner so
unless there is a strong requirement for not using "-i", I'd go for it.

-- 


Attachment: signature.asc
Description: Digital signature

Reply via email to