[Pkg-shadow-devel] Bug#374705: tentative patch

Stephen Gran sgran at debian.org
Wed Jun 21 09:55:36 UTC 2006


Hey all,

I think I might have found the problem.  The mail spool is open()ed, and
then the fd is checked to see if there is an error (as is proper).  The
problem is, the fchown/fchmod calls happen in the same logic path as
error handling, not in an else block.  The attached patch should fix it.

I have to note in passing, though, that I had to change the line

if (strcasecmp (create_mail_spool, "yes") == 0) {

to 

if (strcasecmp (def_create_mail_spool, "yes") == 0) {

to even enter this block in the first place - is there an incomplete
variable name transition, or am I doing something wrong?

--- src/useradd.c~      2006-06-21 10:51:01.000000000 +0100
+++ src/useradd.c       2006-06-21 10:51:17.000000000 +0100
@@ -1599,6 +1599,7 @@
                if (fd < 0) {
                        perror (_("Creating mailbox file"));
                        return;
+               } else {

                        gr = getgrnam ("mail");
                        if (!gr) {

Take care,
-- 
 -----------------------------------------------------------------
|   ,''`.                                            Stephen Gran |
|  : :' :                                        sgran at debian.org |
|  `. `'                        Debian user, admin, and developer |
|    `-                                     http://www.debian.org |
 -----------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/attachments/20060621/0fad5403/attachment.pgp


More information about the Pkg-shadow-devel mailing list