[Pkg-shadow-devel] Bug#750752: passwd: cppw destroys files if named passwd.new group.new or shadow.new as source for the copy

Ben Polman Ben.Polman at science.ru.nl
Fri Jun 6 14:29:10 UTC 2014


Package: passwd
Version: 1:4.1.5.1-1ubuntu9
Severity: normal

Dear Maintainer,


   * What led up to the situation?
trying to use passwd.new as an intermediary file for
cppw /etc/passwd.new
result is that passwd.new is removed and passwd is 0 bytes long.
The reason for this is that cppw does not use a tmpfile to create
the intermediary file but uses passwd.new (and similarly group.new and
shadow.new)

This effectively destroys the source file passwd.new I had created as source
file to be copied.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?
renaming my source for the passwd replacement fixed it but it took a while and
searching through the source code of cppw to understand what was happening.

   * What was the outcome of this action?
that solves my problem for now
   * What outcome did you expect instead?
cppw should never accidentally destroy an existing file, it should use a real
tmpfile

as a side note the man page of cppw (and cpgr) are outdated.
The options are not all mentioned and cpgr will overwrite passwd
if you use it in the form
cpgr /etc/group.file

best regards
Ben Polman




-- System Information:
Debian Release: jessie/sid
  APT prefers trusty-updates
  APT policy: (500, 'trusty-updates'), (500, 'trusty-security'), (500, 'trusty'), (100, 'trusty-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.13.0-27-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages passwd depends on:
ii  debianutils     4.4
ii  libc6           2.19-0ubuntu6
ii  libpam-modules  1.1.8-1ubuntu2
ii  libpam0g        1.1.8-1ubuntu2
ii  libselinux1     2.2.2-1ubuntu0.1
ii  libsemanage1    2.2-1

passwd recommends no packages.

passwd suggests no packages.

-- no debconf information



More information about the Pkg-shadow-devel mailing list