Debian Bug report logs - #496915
[base-files] Modifications related to GSoC project PamNssInstaller

Package: libc6; Maintainer for libc6 is GNU Libc Maintainers <debian-glibc@lists.debian.org>; Source for libc6 is src:eglibc.

Reported by: Juan Luis Belmonte <jlbelmonte@gmail.com>

Date: Thu, 28 Aug 2008 14:33:06 UTC

Severity: wishlist

Tags: patch

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Santiago Vila <sanvila@debian.org>:
Bug#496915; Package base-files. Full text and rfc822 format available.

Acknowledgement sent to Juan Luis Belmonte <jlbelmonte@gmail.com>:
New Bug report received and forwarded. Copy sent to Santiago Vila <sanvila@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Juan Luis Belmonte <jlbelmonte@gmail.com>
To: submit@bugs.debian.org
Subject: [base-files] Modifications related to GSoC project PamNssInstaller
Date: Thu, 28 Aug 2008 18:29:14 +0200
[Message part 1 (text/plain, inline)]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Package: base-files
Version: 4.0.4
Severity: wishlist
Tags: patch

As part of the GSoC project PamNssInstaller
(http://wiki.debian.org/SummerOfCode2008/PamNssDebianInstaller).
Some modifications would be needed in base-files.
  - Providing a script called update-nsswitch. In charge of modifing
nsswitch.conf
  - Modification in debian/rules for installing it under /sbin
  - update-nsswitch manpage

- -- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.25-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages base-files depends on:
ii  base-passwd                   3.5.17     Debian base system master
password
ii  mawk [awk]                    1.3.3-11.1 a pattern scanning and text
proces

base-files recommends no packages.

base-files suggests no packages.

- -- no debconf information
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAki20lMACgkQ2bQWnnlfiVRJfACfSwq/qJeS9tlr8Fx0wdsqT9uX
GikAoMlDva1N1PyEgANaWOgPiRf54R86
=xMNC
-----END PGP SIGNATURE-----
[base-files-4.0.4.patch (text/x-patch, inline)]
diff -Naur base-files-4.0.4ORIGINAL/debian/directory-list base-files-4.0.4/debian/directory-list
--- base-files-4.0.4ORIGINAL/debian/directory-list	2005-07-12 17:31:01.000000000 +0200
+++ base-files-4.0.4/debian/directory-list	2008-07-31 23:57:13.000000000 +0200
@@ -22,6 +22,7 @@
 usr/share/dict
 usr/share/info
 usr/share/man
+usr/share/man/man1
 usr/share/misc
 usr/src
 var
diff -Naur base-files-4.0.4ORIGINAL/debian/rules base-files-4.0.4/debian/rules
--- base-files-4.0.4ORIGINAL/debian/rules	2008-03-11 11:02:27.000000000 +0100
+++ base-files-4.0.4/debian/rules	2008-07-31 23:57:13.000000000 +0200
@@ -34,8 +34,10 @@
 	cd debian && install -m 755 preinst postinst tmp/DEBIAN
 	cd debian && install -m 644 conffiles tmp/DEBIAN
 	cd debian/tmp && install -d `cat ../directory-list`
+	install -p -m 755 sbin/update-* debian/tmp/sbin
 	install -p -m 644 share/* debian/tmp/usr/share/base-files
 	install -p -m 644 licenses/* debian/tmp/usr/share/common-licenses
+	install -p -m 644 man/man1/* debian/tmp/usr/share/man/man1
 	ln -s GFDL-1.2 debian/tmp/usr/share/common-licenses/GFDL
 	ln -s LGPL-3 debian/tmp/usr/share/common-licenses/LGPL
 	ln -s GPL-3 debian/tmp/usr/share/common-licenses/GPL
@@ -54,7 +56,9 @@
 		> debian/tmp/etc/issue.net
 	gzip -9 $(docdir)/changelog
 	cd debian/tmp && \
-		md5sum `find usr -type f` > DEBIAN/md5sums
+		md5sum `find usr -type f` > DEBIAN/md5sums && \
+		md5sum  `find sbin -type f ` >> DEBIAN/md5sums
+		
 	chown -R root:root debian/tmp
 	cd debian/tmp && chown root:src     usr/src
 	cd debian/tmp && chown root:staff   var/local
diff -Naur base-files-4.0.4ORIGINAL/man/man1/update-nsswitch.1.gz base-files-4.0.4/man/man1/update-nsswitch.1.gz
--- base-files-4.0.4ORIGINAL/man/man1/update-nsswitch.1.gz	1970-01-01 01:00:00.000000000 +0100
+++ base-files-4.0.4/man/man1/update-nsswitch.1.gz	2008-07-31 23:57:13.000000000 +0200
@@ -0,0 +1,3 @@
+��jHupdate-nsswitch.1�T�n�0=W_A�2�H\���ݚ��$h2`Eڃjѱ0[�$9A�~�(ZN[c@�]���#��mn`ҵJ��:�>�l}���9��&<���*]j�0�š�G�:'���3��~�\���Ⱦ�Hli-��G�[�r��,'���T
+�3K��ݣx`�����]���˅�TZ�[����*��f�J�`mMh��#�UJ��oT	m@��M[� ��/�8���I��TD�k��6ԥ�&��!�)F���'��5�L�,��3B�J�����k�#qqm�Ӻ�4�0"'�r��h���ȸOXZ����)��g�琗`��޺�8u�����J��d���~�6]W ��`Ry���M�6#A��}��c=�t�`B�=8��ـ��O�l`�9��<a��iz�
+��g+�ۗ��+��;��I�٬�6�_���s�ͥRё���T��N;۵}�io
) �ߥ�THv�R�Ԟ�&�c�W��,ѡ	��?B3m%m�ie=I�3�89�z��{d��.�O
��u��"��qrL����������93y]�]|>b�}=��o5�eћO�,H~`��B&�Ƣ���DM.a���r�z�<�̭w���
l�I���;.��A�9�'�����WPu4�x��6r�ݱW��h�	�2z���]�g
\ No newline at end of file
diff -Naur base-files-4.0.4ORIGINAL/sbin/update-nsswitch base-files-4.0.4/sbin/update-nsswitch
--- base-files-4.0.4ORIGINAL/sbin/update-nsswitch	1970-01-01 01:00:00.000000000 +0100
+++ base-files-4.0.4/sbin/update-nsswitch	2008-07-31 23:57:13.000000000 +0200
@@ -0,0 +1,214 @@
+#!/usr/bin/perl -w
+#
+# update-nsswitch
+#
+# Copyright (C) 2004 Fabio Tranchitella <kobold@kobold.it>
+# Copyright (C) 2004 Giuseppe Sacco <eppesuig@debian.org>
+#
+# update-nsswitch is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published
+# by the Free Software Foundation; either version 2 of the License,
+# or (at your option) any later version.
+# 2008 Developer Juan Luis Belmonte <jlbelmonte@gmail.com>
+
+use strict;
+use Getopt::Long;
+use File::Basename qw(basename);
+use File::Temp qw(tempfile);
+
+my $CONF_FILE = "/etc/nsswitch.conf";
+my $VERSION   = '0.03';
+
+sub main {
+	my ( $m_add, $m_remove, $m_version, $m_help, $before, $after, $database,
+		$actionitem );
+	$m_add = $m_remove = 0;
+	$after = $before = $actionitem = "";
+
+	GetOptions(
+		'add|a'        => \$m_add,
+		'remove|r'     => \$m_remove,
+		'database=s'   => \$database,
+		'before=s'     => \$before,
+		'after=s'      => \$after,
+		'actionitem=s' => \$actionitem,
+		'version|v'    => \$m_version,
+		'help|h'       => \$m_help
+	);
+
+	version() if ($m_version);
+	usage()
+	  if ( $m_help
+		or ( $m_add + $m_remove ) != 1
+		or not $database
+		or not @ARGV
+		or ( $after ne "" and $before ne "" ) );
+
+	my $source = shift @ARGV if @ARGV;
+
+	if ($m_add) {
+		return add( $source, $database, $after, $before, $actionitem );
+	}
+	else {
+		return remove( $source, $database );
+	}
+
+}
+
+sub add {
+	my ( $source, $database, $after, $before, $actionitem ) = @_;
+	my $output = "";
+	$actionitem = " [" . "$actionitem" . "]" if ( $actionitem ne "" );
+	my $sourceaction = $source
+	  . $actionitem
+	  ; # solves multiple concatenations on multiple databases with action item calls
+	my @newdbs;
+	my @indbs = split /,/, $database;
+	my $exist = "";
+
+## Splits the whole databases string in a string for existent and an array of non-existent db's
+	foreach my $var (@indbs) {
+		chomp($var);
+		open( IN, $CONF_FILE ) or die "Couldn't open $CONF_FILE $!\n";
+		my $m = 0;
+		while (<IN>) {
+			chomp;
+			if ( $_ =~ /$var/ ) {
+				$m = 1;
+				$exist .= "$var,";
+				last;
+			}
+		}
+		if ( $m eq 0 ) {
+			push( @newdbs, $var );
+		}
+		close IN;
+	}
+
+	open( IN, $CONF_FILE ) or die "Couldn't open $CONF_FILE $!\n";
+
+	#  only the existent databases are going into this loop
+	while (<IN>) {
+		if ( $_ =~ /^#/ or $_ =~ /^[\s\t]+/ ) {
+
+			$output .= $_;
+		}
+		elsif ( $_ =~ /(\S+):[\s\t]+([\S ]+)/ ) {
+			my ( $db, $s ) = ( $1, $2 );
+			if ( $exist =~ /$db/ and $_ !~ /\s$source/ ) {
+
+				## DEFAULT ACTION  if before & after not blank or both blank or if one defined but not exists
+				if (   ( $after eq "" and $before eq "" )
+					or ( $after ne "" and $before ne "" ) )
+				{
+					$after = "THELAST";
+				}
+				if (   ( ( $before ne "" ) and ( $_ !~ /$before/ ) )
+					or ( ( $after ne "" ) and ( $_ !~ /$after/ ) ) )
+				{
+					$after = "THELAST";
+				}
+				###
+
+				if ( $after ne "" ) {
+					if ( $_ =~ /($after( |\t)+)|($after$)/ ) {
+						$_ =~ s/$&/$& $sourceaction /ig;
+					}
+					elsif ( $after eq "THELAST" ) {
+						chop($_);
+
+						$_ = $_ . " $sourceaction" . "\n";
+					}
+				}
+
+				if ( $before ne "" ) {
+					if ( $_ =~ /($before( |\t)+)|($before$)/ ) {
+						$_ =~ s/$&/$sourceaction  $&/ig;
+					}
+				}
+			}
+			$output .= $_;
+		}
+	}
+	close IN;
+
+	# loop for new  databses  addings
+	foreach (@newdbs) {
+		$output .= "$_:\t$sourceaction \n ";
+
+	}
+	tempFile($output);
+}
+
+sub remove {
+	my ( $source, $database ) = @_;
+	my $output = "";
+	open( IN, $CONF_FILE ) or die "Couldn't open $CONF_FILE $!\n";
+	while (<IN>) {
+		if ( $_ =~ /^#/ or $_ =~ /^[\s\t]+/ ) {
+			$output .= $_;
+		}
+		elsif ( $_ =~ /(\S+):[\s\t]+([\S ]+)/ ) {
+			my ( $db, $s ) = ( $1, $2 );
+			if ( $database =~ /$db/ and $_ =~ /\s$source/ ) {
+				$_ =~ s/\s?$source(\s\[[^\]]+\])?//ig;
+				if ( $_ !~ /^\S+:[\s\t]+(\S)+/ ) {
+					last;
+				}
+			}
+			$output .= $_;
+		}
+	}
+	close IN;
+
+	tempFile($output);
+
+}
+
+sub tempFile {
+	my ($output) = @_;
+
+	my ( $tmp, $filetmp ) = tempfile('nsswitch.conf.tmpXXXX')
+	  or die("Couldn't open a temporary file: $!\n");
+	print $tmp $output;
+	close($tmp);
+
+#	rename( $CONF_FILE, "nsswitch.conf.backup" );                       ###Uncomment to createbackup of nsswitch
+	rename( "$filetmp", $CONF_FILE )
+	  or die "Couldn't rename " . $filetmp . ": $!\n";
+	return 0;
+
+}
+
+sub usage {
+	print <<EOT;
+Usage: update-nsswitch [OPTIONS] MODE SOURCE
+
+Options:
+  --version             output version information and exit
+  --help                display this help and exit
+  --database=DB1,DB2..  modify only DB1,DB2... databases
+  --before=SOURCE       add the new source before SOURCE
+  --after=SOURCE        add the new source after SOURCE
+  --actionitem=ACTION   specify the status action clauses quoted between "" (without []) 
+
+Modes:
+  --add SOURCE          add a new source
+  --remove SOURCE       remove an existing source 
+
+EOT
+	exit 0;
+}
+
+sub version {
+	print <<EOT;
+update-pam $VERSION
+EOT
+	exit 0;
+}
+
+######################################
+## MAIN CALL, PLEASE DON'T CHANGE IT #
+######################################
+
+exit main();

Information forwarded to debian-bugs-dist@lists.debian.org, Santiago Vila <sanvila@debian.org>:
Bug#496915; Package base-files. Full text and rfc822 format available.

Acknowledgement sent to Santiago Vila <sanvila@unex.es>:
Extra info received and forwarded to list. Copy sent to Santiago Vila <sanvila@debian.org>. Full text and rfc822 format available.

Message #10 received at 496915@bugs.debian.org (full text, mbox):

From: Santiago Vila <sanvila@unex.es>
To: Juan Luis Belmonte <jlbelmonte@gmail.com>, 496915@bugs.debian.org
Cc: control@bugs.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>
Subject: Re: Bug#496915: [base-files] Modifications related to GSoC project PamNssInstaller
Date: Fri, 29 Aug 2008 10:50:09 +0200 (CEST)
reassign 496915 libc6
thanks

The submitter suggests adding a perl script called update-nsswitch to
base-files, but I consider that to be a bad idea, as base-files is not
supposed to contain any binaries. The file nsswitch.conf is really a
configuration file for libc6, so I reassign this bug to libc6.

Maybe nsswitch.conf should be in libc6 as well, but for now I don't mind
if it's still part of base-files.

Thanks.




Bug reassigned from package `base-files' to `libc6'. Request was from Santiago Vila <sanvila@unex.es> to control@bugs.debian.org. (Fri, 29 Aug 2008 08:51:06 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#496915; Package libc6. Full text and rfc822 format available.

Acknowledgement sent to Juan Luis Belmonte <jlbelmonte@gmail.com>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. Full text and rfc822 format available.

Message #17 received at 496915@bugs.debian.org (full text, mbox):

From: Juan Luis Belmonte <jlbelmonte@gmail.com>
Cc: 496915@bugs.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>
Subject: Re: Bug#496915: [base-files] Modifications related to GSoC project PamNssInstaller
Date: Thu, 18 Sep 2008 01:28:50 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

some weeks ago we submited this report. And it was reassigned yo libc6.
But there isn't any more feedback since august 29th.

how is it going?
If you think it suits in libc6, may I create a patch for adding it?

Well, if you want something from us do not hesitate contacting me or  my
mentor Fabio Tranchitella.


Thaks for all.
Cheers


Santiago Vila wrote:
> reassign 496915 libc6
> thanks
> 
> The submitter suggests adding a perl script called update-nsswitch to
> base-files, but I consider that to be a bad idea, as base-files is not
> supposed to contain any binaries. The file nsswitch.conf is really a
> configuration file for libc6, so I reassign this bug to libc6.
> 
> Maybe nsswitch.conf should be in libc6 as well, but for now I don't mind
> if it's still part of base-files.
> 
> Thanks.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkjRkqYACgkQ2bQWnnlfiVR7DACfQAy1ByxkSMEUOJ8gWpK697b6
mDAAn0lgSVm/YVD2QDLnhxWKW0GmtV2B
=AwYT
-----END PGP SIGNATURE-----




Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#496915; Package libc6. (Sat, 29 May 2010 16:00:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Sat, 29 May 2010 16:00:06 GMT) Full text and rfc822 format available.

Message #22 received at 496915@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 496915@bugs.debian.org
Subject: Re: Modifications related to GSoC project PamNssInstaller
Date: Sat, 29 May 2010 17:58:40 +0200
Any hope of having this system for handling /etc/nsswitch.conf
integrated into Debian any time soon?  It would be very nice to have
this in place before Squeeze.  With pam-auth-update in place, the need
for automatic configuration of nsswitch.conf is even more pressing
when wanting to configure PAM and NSS out of the box. :)

Happy hacking,
-- 
Petter Reinholdtsen




Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#496915; Package libc6. (Sun, 30 May 2010 10:12:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Aurelien Jarno <aurelien@aurel32.net>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Sun, 30 May 2010 10:12:04 GMT) Full text and rfc822 format available.

Message #27 received at 496915@bugs.debian.org (full text, mbox):

From: Aurelien Jarno <aurelien@aurel32.net>
To: Petter Reinholdtsen <pere@hungry.com>, 496915@bugs.debian.org
Subject: Re: Bug#496915: Modifications related to GSoC project PamNssInstaller
Date: Sun, 30 May 2010 12:08:36 +0200
On Sat, May 29, 2010 at 05:58:40PM +0200, Petter Reinholdtsen wrote:
> Any hope of having this system for handling /etc/nsswitch.conf
> integrated into Debian any time soon?  It would be very nice to have
> this in place before Squeeze.  With pam-auth-update in place, the need
> for automatic configuration of nsswitch.conf is even more pressing
> when wanting to configure PAM and NSS out of the box. :)
> 

Like any wishlist bug this bug will stay out of the radar until we have
some more manpower.

I haven't tested the patch, but the main problem I see is that this is a
perl script. We certainly don't want to make libc6 or libc-bin depends
on perl, which will introduce another dependency loop. Also it's
probably not a good choice while people are trying to remove the usage
of perl in the base system.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net




Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#496915; Package libc6. (Sun, 30 May 2010 10:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Sun, 30 May 2010 10:27:03 GMT) Full text and rfc822 format available.

Message #32 received at 496915@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 496915@bugs.debian.org
Subject: Re: Bug#496915: Modifications related to GSoC project PamNssInstaller
Date: Sun, 30 May 2010 12:22:57 +0200
Thank you for the feedback.

[Aurelien Jarno]
> Like any wishlist bug this bug will stay out of the radar until we
> have some more manpower.
> 
> I haven't tested the patch, but the main problem I see is that this
> is a perl script. We certainly don't want to make libc6 or libc-bin
> depends on perl, which will introduce another dependency loop. Also
> it's probably not a good choice while people are trying to remove
> the usage of perl in the base system.

Perhaps it is better to move this feature to a separate package, like
the update-inetd package?  Seem a bit overkill to create a new package
for a simple perl script, but it might be the best way to do this.

Happy hacking,
-- 
Petter Reinholdtsen




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 01:16:02 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.