severity 518908 minor
thanks

On Mon, Mar 09, 2009 at 05:21:45PM +1100, Daniel Pittman wrote:
> libpam-modules ships with the pam_namespace module to automatically create
> and mount per-user or per-context directories in a detached namespace.

> This includes a script, /etc/security/namespace.init, that attempts to
> populate an automatically created home directory with the content of
> /etc/skel; this script depends on gawk but that dependency is not declared.

> The problem is here:

>     mode=$(awk '/^UMASK/{gsub("#.*$", "", $2); printf "%o", 
> and(0777,compl(strtonum("0" $2))); exit}' /etc/login.defs)

> mawk, which was installed on the machine where I was using this, reports these
> errors by default:

> awk: line 2: function and never defined
> awk: line 2: function compl never defined
> awk: line 2: function strtonum never defined

> This is non-fatal — the PAM module works, installs the new directory and so
> forth, but it is not ideal.

> Installing gawk automatically corrected the problem, but this was not
> declared or noted anywhere in the package.

Since pam_namespace is not used by default, the appropriate package
relationship here would only be a Suggests:, not a Depends: - which means
the dependency would still not be pulled in by default.

Better would be if we had a script that worked with any version of awk.
I'll look into fixing this.  Note also that even with gawk installed, by
default this line returns nothing, since there is no 'UMASK' line
uncommented in /etc/login.defs.

This probably works:

  mask=$(awk '/^UMASK/{gsub("#.*$", "", $2); print $2; exit}' /etc/login.defs)
  mode=$(printf "%o" $((0777 & ~$mask)))

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to