Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1242597 > unrolled thread

Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will.

Started byMark Symonds <mark@syminet.com>
First post2025-04-18 17:10 +0200
Last post2025-05-09 19:10 +0200
Articles 7 — 3 participants

Back to article view | Back to linux.debian.bugs.dist


Contents

  Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will. Mark Symonds <mark@syminet.com> - 2025-04-18 17:10 +0200
    Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will. Mark - Syminet <mark@syminet.com> - 2025-04-18 17:40 +0200
    Bug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will. Chris Hofstaedtler <zeha@debian.org> - 2025-04-18 17:40 +0200
      Bug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will. Mark - Syminet <mark@syminet.com> - 2025-04-18 18:30 +0200
        Bug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will. Chris Hofstaedtler <zeha@debian.org> - 2025-04-18 19:00 +0200
          Bug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will. Mark - Syminet <mark@syminet.com> - 2025-04-18 20:00 +0200
    Bug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will. Mark - Syminet <mark@syminet.com> - 2025-05-09 19:10 +0200

#1242597 — Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will.

FromMark Symonds <mark@syminet.com>
Date2025-04-18 17:10 +0200
SubjectBug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will.
Message-ID<KCVvP-esoO-5@gated-at.bofh.it>
Package: passwd
Version: 1:4.17.4-1
Severity: normal
Tags: patch

Dear Maintainer,

In useradd(8), we have the following: 

   -d, --home-dir HOME_DIR
       The new user will be created using HOME_DIR as the value for the user's login directory. The default is to append the LOGIN name to BASE_DIR and use that
       as the login directory name. If the directory HOME_DIR does not exist, then it will be created unless the -M option is specified.

The last sentence says HOME_DIR will be created, but it is not.  Looking further, 
it appears the reason is because CREATE_HOME does not exist in /etc/login.defs 

I've attached a patch to remove the last sentence of above description.  


-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.17-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages passwd depends on:
ii  base-passwd     3.6.7
ii  libacl1         2.3.2-2+b1
ii  libattr1        1:2.5.2-3
ii  libaudit1       1:4.0.2-2+b2
ii  libbsd0         0.12.2-2
ii  libc6           2.41-6
ii  libcrypt1       1:4.4.38-1
ii  libpam-modules  1.7.0-3
ii  libpam0g        1.7.0-3
ii  libselinux1     3.8.1-1
ii  libsemanage2    3.8.1-1
ii  login.defs      1:4.17.4-1

Versions of packages passwd recommends:
ii  sensible-utils  0.0.24

passwd suggests no packages.

-- no debconf information

[toc] | [next] | [standalone]


#1242600

FromMark - Syminet <mark@syminet.com>
Date2025-04-18 17:40 +0200
Message-ID<KCVYS-esDz-9@gated-at.bofh.it>
In reply to#1242597

[Multipart message — attachments visible in raw view] — view raw

Here's the patch 



[toc] | [prev] | [next] | [standalone]


#1242601 — Bug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will.

FromChris Hofstaedtler <zeha@debian.org>
Date2025-04-18 17:40 +0200
SubjectBug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will.
Message-ID<KCVYS-esDz-11@gated-at.bofh.it>
In reply to#1242597
* Mark Symonds via Pkg-shadow-devel <pkg-shadow-devel@alioth-lists.debian.net> [250418 17:09]:
>Package: passwd
>Version: 1:4.17.4-1
>Severity: normal
>Tags: patch
>
>Dear Maintainer,
>
>In useradd(8), we have the following:
>
>   -d, --home-dir HOME_DIR
>       The new user will be created using HOME_DIR as the value for the user's login directory. The default is to append the LOGIN name to BASE_DIR and use that
>       as the login directory name. If the directory HOME_DIR does not exist, then it will be created unless the -M option is specified.
>
>The last sentence says HOME_DIR will be created, but it is not.  Looking further,
>it appears the reason is because CREATE_HOME does not exist in /etc/login.defs
>
>I've attached a patch to remove the last sentence of above description.

(the patch appears to be missing)

If, as you say, this is configurable in /etc/login.defs, then: IMO 
it would be better to send a patch describing the configurable 
behaviour, and sending that upstream.

For option -M, there is already some text about CREATE_HOME.
I guess it was an overseen that -d would also need some text.

Best,
Chris

[toc] | [prev] | [next] | [standalone]


#1242606 — Bug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will.

FromMark - Syminet <mark@syminet.com>
Date2025-04-18 18:30 +0200
SubjectBug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will.
Message-ID<KCWLf-eth7-1@gated-at.bofh.it>
In reply to#1242601

[Multipart message — attachments visible in raw view] — view raw

On Fri, 2025-04-18 at 17:31 +0200, Chris Hofstaedtler wrote:
> 
> (the patch appears to be missing)
> 

Apologies for that, reportbug went into a loop prompting for the filename, 
so I just hit <enter> to submit and sent right after; should show up any 
minute.  

> If, as you say, this is configurable in /etc/login.defs, then: IMO 
> it would be better to send a patch describing the configurable 
> behaviour, and sending that upstream.
> 

Do you know offhand if CREATE_HOME not being in /etc/login.defs is 
debian specific?  (so upstream doesn't bounce it back) 

> For option -M, there is already some text about CREATE_HOME.
> I guess it was an overseen that -d would also need some text.
> 

Yes, I'm guessing same.  

Best - 

-- 
Mark 



[toc] | [prev] | [next] | [standalone]


#1242612 — Bug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will.

FromChris Hofstaedtler <zeha@debian.org>
Date2025-04-18 19:00 +0200
SubjectBug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will.
Message-ID<KCXeh-etxW-15@gated-at.bofh.it>
In reply to#1242606
* Mark - Syminet <mark@syminet.com> [250418 18:27]:
>On Fri, 2025-04-18 at 17:31 +0200, Chris Hofstaedtler wrote:
>> If, as you say, this is configurable in /etc/login.defs, then: IMO
>> it would be better to send a patch describing the configurable
>> behaviour, and sending that upstream.
>>
>
>Do you know offhand if CREATE_HOME not being in /etc/login.defs is
>debian specific?  (so upstream doesn't bounce it back)

So, apparently shadow-4.1.3 introduced CREATE_HOME, with this note 
in NEWS:

- /etc/login.defs
   * New CREATE_HOME variable to tell useradd to create a home directory by
     default.

useradd.c turns on creating a homedir, if it sees either -m or 
CREATE_HOME. (using getdef_bool, which defaults to false.)
  
The etc/login.defs file shipped by upstream, has this contents:

   #
   # If useradd(8) should create home directories for users by default (non
   # system users only).
   # This option is overridden with the -M or -m flags on the useradd(8)
   # command-line.
   #
   #CREATE_HOME     yes
   
IOW: CREATE_HOME is _off_ by default upstream. This appears to be unchanged 
since 4.1.2.

Chris

[toc] | [prev] | [next] | [standalone]


#1242619 — Bug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will.

FromMark - Syminet <mark@syminet.com>
Date2025-04-18 20:00 +0200
SubjectBug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will.
Message-ID<KCYal-eufR-1@gated-at.bofh.it>
In reply to#1242612

[Multipart message — attachments visible in raw view] — view raw

On Fri, 2025-04-18 at 18:50 +0200, Chris Hofstaedtler wrote:
> 
> IOW: CREATE_HOME is _off_ by default upstream. This appears to be unchanged 
> since 4.1.2.
> 

Yes, I'm seeing same.  Upstream bugreport filed: 

https://github.com/shadow-maint/shadow/issues/1249

Thanks much for confirming so quickly! 

-- 
Mark 




[toc] | [prev] | [next] | [standalone]


#1245365 — Bug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will.

FromMark - Syminet <mark@syminet.com>
Date2025-05-09 19:10 +0200
SubjectBug#1103523: [Pkg-shadow-devel] Bug#1103523: passwd: username -d does not create HOME_DIR when useradd(8) says it will.
Message-ID<KKzot-1TJV-1@gated-at.bofh.it>
In reply to#1242597

[Multipart message — attachments visible in raw view] — view raw

Okay, we see that patch was applied upstream resolving this.  Thanks much!  

Best - 

-- 
Mark 


[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.bugs.dist


csiph-web