Bug#333871: improved(?) description of nsswitch.conf semantics

2008-01-30 Thread Martin Schulze
Vincent McIntyre wrote:
 *** Please type your report below this line ***
 Hi

 The nsswitch.conf(5) manpage does not explain how to override some fields in
 /etc/passwd, with the compat option. In fact I could not easily find any
 reference to the full +/- semantics mentioned in the page.

 The patch below may improve the situation. Please consider applying it,
 or something like it.  I would be grateful if you could add a pointer
 to the documentation for the full +/- semantics.

 -- snip 
 
 --- nsswitch.conf.5.orig  2005-10-14 17:44:48.097267000 +1000
 +++ nsswitch.conf.5   2005-10-14 18:16:14.582098000 +1000
 @@ -207,7 +207,25 @@
  (include the specified user from the NIS passwd map),
  -user or [EMAIL PROTECTED] (exclude the specified user),
  and + (include every user, except the excluded ones, from the NIS
 -passwd map). Since most people only put a + at the end of
 +passwd map).
 +.LP
 +The +/- syntax has a nice property: it is possible to selectively
 +override certain fields in /etc/passwd, while taking the rest of the
 +information from the NIS passwd map. For example you may have a user
 +who should get a home directory local to the machine, rather than
 +an NFS-automounted directory. In such a case you could put the line
 +.sp
 +.RS
 +.nf
 ++fred:/local/fred:
 +.fi
 +.RE
 +.PP
 +in
 +.B /etc/passwd, which will allow user 'fred' to login using their
 +NIS password, but which will set their home directory to /local/fred.
 +.LP
 +Since most people only put a + at the end of
  .B /etc/passwd
  to include everything from NIS, the switch provides a faster
  alternative for this case (`passwd: files nis') which doesn't
 @@ -217,13 +235,14 @@
  and
  .BR /etc/shadow .
  If this is not sufficient, the NSS `compat' service provides full
 -+/- semantics. By default, the source is `nis', but this may be
 ++/- semantics (such as selective replacement of passwd entry elements).
 +By default, the source is `nis', but this may be
  overriden by specifying `nisplus' as source for the pseudo-databases
  .BR passwd_compat,
  .B group_compat
  and
  .BR shadow_compat.
 -This pseudo-databases are only available in GNU C Library.
 +These pseudo-databases are only available in the GNU C Library.
  .SH FILES
  A service named SERVICE is implemented by a shared object library named
  .BI libnss_SERVICE.so. X

I'll add:

   You can override certain passwd fields for a particular user  from  the
   NIS   passwd   map  by  using  the  extended  form  of  +user::  in
   /etc/passwd.  Non-empty fields override information in the  NIS  passwd
   map.

Regards,

Joey

-- 
Life is too short to run proprietary software.  -- Bdale Garbee

Please always Cc to me when replying to me on the lists.
Index: man5/nsswitch.conf.5
===
RCS file: /var/cvs/debian/manpages/man5/nsswitch.conf.5,v
retrieving revision 1.18
diff -u -p -r1.18 nsswitch.conf.5
--- man5/nsswitch.conf.528 Jan 2008 16:24:09 -  1.18
+++ man5/nsswitch.conf.530 Jan 2008 16:21:56 -
@@ -223,6 +223,12 @@ you could have entries of the form +user
 \-user or [EMAIL PROTECTED] (exclude the specified user),
 and + (include every user, except the excluded ones, from the NIS
 passwd map).
+
+You can override certain passwd fields for a particular user from the
+NIS passwd map by using the extended form of +user:: in
+.IR /etc/passwd .
+Non-empty fields override information in the NIS passwd map.
+
 Since most people only put a + at the end of
 .I /etc/passwd
 to include everything from NIS, the switch provides a faster
@@ -240,7 +246,7 @@ overridden by specifying `nisplus' as so
 .B group_compat
 and
 .BR shadow_compat .
-This pseudo-databases are only available in GNU C Library.
+These pseudo-databases are only available in GNU C Library.
 .SH FILES
 A service named SERVICE is implemented by a shared object library named
 .BI libnss_SERVICE.so. X


Bug#333871: improved(?) description of nsswitch.conf semantics

2005-10-14 Thread Vincent McIntyre

Package: base-files
Version: 3.1.2
Severity: minor

*** Please type your report below this line ***
Hi

The nsswitch.conf(5) manpage does not explain how to override some fields in
/etc/passwd, with the compat option. In fact I could not easily find any
reference to the full +/- semantics mentioned in the page.

The patch below may improve the situation. Please consider applying it,
or something like it.  I would be grateful if you could add a pointer
to the documentation for the full +/- semantics.

-- snip 
--- nsswitch.conf.5.orig2005-10-14 17:44:48.097267000 +1000
+++ nsswitch.conf.5 2005-10-14 18:16:14.582098000 +1000
@@ -207,7 +207,25 @@
 (include the specified user from the NIS passwd map),
 -user or [EMAIL PROTECTED] (exclude the specified user),
 and + (include every user, except the excluded ones, from the NIS
-passwd map). Since most people only put a + at the end of
+passwd map).
+.LP
+The +/- syntax has a nice property: it is possible to selectively
+override certain fields in /etc/passwd, while taking the rest of the
+information from the NIS passwd map. For example you may have a user
+who should get a home directory local to the machine, rather than
+an NFS-automounted directory. In such a case you could put the line
+.sp
+.RS
+.nf
++fred:/local/fred:
+.fi
+.RE
+.PP
+in
+.B /etc/passwd, which will allow user 'fred' to login using their
+NIS password, but which will set their home directory to /local/fred.
+.LP
+Since most people only put a + at the end of
 .B /etc/passwd
 to include everything from NIS, the switch provides a faster
 alternative for this case (`passwd: files nis') which doesn't
@@ -217,13 +235,14 @@
 and
 .BR /etc/shadow .
 If this is not sufficient, the NSS `compat' service provides full
-+/- semantics. By default, the source is `nis', but this may be
++/- semantics (such as selective replacement of passwd entry elements).
+By default, the source is `nis', but this may be
 overriden by specifying `nisplus' as source for the pseudo-databases
 .BR passwd_compat,
 .B group_compat
 and
 .BR shadow_compat.
-This pseudo-databases are only available in GNU C Library.
+These pseudo-databases are only available in the GNU C Library.
 .SH FILES
 A service named SERVICE is implemented by a shared object library named
 .BI libnss_SERVICE.so. X



-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages base-files depends on:
ii  base-passwd   3.5.9  Debian base system master password
ii  gawk [awk]1:3.1.4-2  GNU awk, a pattern scanning and pr
ii  mawk [awk]1.3.3-11   a pattern scanning and text proces

-- no debconf information


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]