Solved Upgrade from 14.3p1 to 14.3p2 using pkgbase

tl;dr : not a pleasant experience indeed.

This is what actually happened.
  • First I had to upgrade pkg to 2.2.1 to 2.2.2. So far so good.
  • Then I got a lot of packages to upgrade, all the base packages plus KDE Plasma going from 6.4.3 to 6.4.4, plus libreoffice, librewolf and so on. Well, lots of stuff but that's what BEs are for, so I interrupted the download and created a new BE.
  • Then I restarted the upgrade. There were a lot of scary messages like /libexec/ld-elf.so.1 not found but all ended without any more errors.
  • As a further precaution, I started the upgrade process again and it found nothing more to do, so I rebooted my laptop.
Black screen.

I opened a terminal (Ctrl+Alt+F1), logged in as root and stopped lightdm to start X manually. It didn't work but it complained that it couldn't write something related to the keyboard in /tmp and sure the permissions in /tmp looked wrong to me, they were like 755; I honestly don't remember what they were before but my 30+ years with Unix told me that /tmp must be set to 1777 and so I did.

That worked, as I'm now writing this under 14.3p2.

I don't actually know if this is pkgbase related but this is the first time I had any problems in a FreeBSD update and honestly I don't see what else can change the /tmp permissions other than an OS upgrade.

I'll reboot my laptop again and report back.

Edit: all good.

Code:
[10:22][fmc000@tu45b-freebsd ~]$ ls -la /tmp           
total 61
drwxrwxrwt   8 root   wheel 10 Aug  9 10:22 .
drwxr-xr-x  24 root   wheel 30 Aug  9 10:22 ..
drwxrwxrwt   2 root   wheel  3 Aug  9 10:22 .ICE-unix
-r--r--r--   1 root   wheel 11 Aug  9 10:22 .X0-lock
drwxrwxrwt   2 root   wheel  3 Aug  9 10:22 .X11-unix
drwxrwxrwt   2 root   wheel  2 Aug  9 10:22 .XIM-unix
drwxrwxrwt   2 root   wheel  2 Aug  9 10:22 .font-unix
srwxrwxrwx   1 fmc000 wheel  0 Aug  9 10:22 dbus-wlDXFTm1Ff
drwx------   2 fmc000 wheel  2 Aug  9 10:22 plasma-csd-generator.IsVtaf
drwx------   2 root   wheel  2 Aug  9 10:22 simple-mtpfs-OQV8zP
[10:23][fmc000@tu45b-freebsd ~]$
 
Pure basic ZFS autoinstallation plus a few VMs and my google drive backup via rclone.

Code:
[10:29][fmc000@tu45b-freebsd ~]$ df    
Filesystem          Type    1K-blocks      Used     Avail Capacity  Mounted on
zroot/ROOT/default  zfs     257840976  13683204 244157772     5%    /
devfs               devfs           1         0         1     0%    /dev
/dev/gpt/efiboot0   msdosfs    266144      1360    264784     1%    /boot/efi
procfs              procfs          8         0         8     0%    /proc
fdescfs             fdescfs         1         0         1     0%    /dev/fd
tmpfs               tmpfs    28098636         4  28098632     0%    /tmp
zroot/var/mail      zfs        102052       144    101908     0%    /var/mail
zroot/var/tmp       zfs       2096292       220   2096072     0%    /var/tmp
zroot/home          zfs     244157868        96 244157772     0%    /home
zroot/var/log       zfs       5235352      3312   5232040     0%    /var/log
zroot/tmp           zfs       5239036       192   5238844     0%    /tmp
zroot/var/crash     zfs       2097024        96   2096928     0%    /var/crash
zroot               zfs     244157868        96 244157772     0%    /zroot
zroot/usr/src       zfs      20971440   2730968  18240472    13%    /usr/src
zroot/var/audit     zfs        102400        96    102304     0%    /var/audit
zroot/vm            zfs      63186640  14870064  48316576    24%    /vm
zroot/usr/ports     zfs      47130288   3442408  43687880     7%    /usr/ports
zroot/gdrive        zfs     209715136 139109212  70605924    66%    /gdrive
zroot/home/fmc000   zfs      49136820   2020396  47116424     4%    /home/fmc000
zroot/vm/fbsd14     zfs      63206168  14889592  48316576    24%    /vm/fbsd14
zroot/vm/win11      zfs      64790576  16474000  48316576    25%    /vm/win11
zroot/vm/POP-OS     zfs      58623944  10307368  48316576    18%    /vm/POP-OS
[11:07][fmc000@tu45b-freebsd ~]$
 
There are two tmp file systems mounted on the same mount point, one tmpfs and one ZFS dataset
Code:
[10:29][fmc000@tu45b-freebsd ~]$ df
Filesystem          Type    1K-blocks      Used     Avail Capacity  Mounted on

tmpfs               tmpfs    28098636         4  28098632     0%    /tmp

zroot/tmp           zfs       5239036       192   5238844     0%    /tmp
You should decide which to keep.
 
Updating pkg 2.2.1->2.2.2 - no problem.
35 patches installed without problems (14.3-RELEASE-p2).
/tmp directory (chmod) -> 41777
 
There are two tmp file systems mounted on the same mount point, one tmpfs and one ZFS dataset

You should decide which to keep.
Thanks for spotting this obvious mistake, I've fixed it.

However, this was present since day 1 so I very much doubt that it was my issue.
 
Updating pkg 2.2.1->2.2.2 - no problem.
35 patches installed without problems (14.3-RELEASE-p2).
/tmp directory (chmod) -> 41777
First time in my life I've seen a five-digit chmod.

Code:
MODES
     Modes may be absolute or symbolic.  An absolute mode is an octal number
     constructed from the sum of one or more of the following values:

           4000    (the setuid bit).  Executable files with this bit set will
                   run with effective uid set to the uid of the file owner.
                   Directories with this bit set will force all files and sub-
                   directories created in them to be owned by the directory
                   owner and not by the uid of the creating process, if the
                   underlying file system supports this feature: see chmod(2)
                   and the suiddir option to mount(8).
           2000    (the setgid bit).  Executable files with this bit set will
                   run with effective gid set to the gid of the file owner.
           1000    (the sticky bit).  See chmod(2) and sticky(7).
           0400    Allow read by owner.
           0200    Allow write by owner.
           0100    For files, allow execution by owner.  For directories,
                   allow the owner to search in the directory.
           0040    Allow read by group members.
           0020    Allow write by group members.
           0010    For files, allow execution by group members.  For
                   directories, allow group members to search in the
                   directory.
           0004    Allow read by others.
           0002    Allow write by others.
           0001    For files, allow execution by others.  For directories
                   allow others to search in the directory.
 
Does this happen to anyone else?

Code:
[11:23][fmc000@tu45b-freebsd ~]$ pkg info  FreeBSD-ftpd
FreeBSD-ftpd-14.3p2
Name           : FreeBSD-ftpd
Version        : 14.3p2
Installed on   : Sat Aug  9 09:52:40 2025 CEST
Origin         : base
Architecture   : FreeBSD:14:amd64
Prefix         : /
Categories     : base
Licenses       : BSD2CLAUSE
Maintainer     : re@FreeBSD.org
WWW            : https://www.FreeBSD.org
Comment        : FTP Daemon
Shared Libs required:
        libblacklist.so.0
        libc.so.7
        libcrypt.so.5
        libm.so.5
        libmd.so.6
        libpam.so.6
        libutil.so.9
Annotations    :
        FreeBSD_version: 1403000
        repo_type      : binary
        repository     : FreeBSD-base
Flat size      : 110KiB
Description    :
FTP Daemon
[11:23][fmc000@tu45b-freebsd ~]$ pkg version -qvRL=|grep -i 'needs updating'
FreeBSD-ftpd-14.3p2                <   needs updating (remote has 20240719)
[11:24][fmc000@tu45b-freebsd ~]$
 
Name : FreeBSD-ftpd
Hmm, tracking either quarterly or latest, I cannot get hold of 'FreeBSD-ftpd', with that specific capitalisation.
How did you get yours?

Using latest, I have:
Code:
[0-0] # ls -l /usr/ports/ftp/ | grep -i 'FreeBSD-ftpd'
drwxr-xr-x  2 root wheel    6 Apr  1 21:09 freebsd-ftpd
[1-0] # grep -i 'FreeBSD-ftpd' </usr/ports/ftp/freebsd-ftpd/Makefile
PORTNAME=       freebsd-ftpd
WWW=            https://github.com/cschuber/freebsd-ftpd
[2-0] # pkg rquery -e '%n=freebsd-ftpd || %n=FreeBSD-ftpd' '[%R] %o %n %v'
[FreeBSD] ftp/freebsd-ftpd freebsd-ftpd 20240719
[3-0] #
 
Code:
[11:23][fmc000@tu45b-freebsd ~]$ pkg info  FreeBSD-ftpd
FreeBSD-ftpd-14.3p2
Name           : FreeBSD-ftpd
Version        : 14.3p2
Installed on   : Sat Aug  9 09:52:40 2025 CEST
Origin         : base
Architecture   : FreeBSD:14:amd64
Prefix         : /
Categories     : base
Licenses       : BSD2CLAUSE
Maintainer     : re@FreeBSD.org
WWW            : https://www.FreeBSD.org
That looks like you have something different, I get:
Rich (BB code):
[10-0] # pkg ins FreeBSD-ftpd
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        freebsd-ftpd: 20240719 [FreeBSD]

Number of packages to be installed: 1

Proceed with this action? [y/N]: y
[1/1] Installing freebsd-ftpd-20240719...
[1/1] Extracting freebsd-ftpd-20240719: 100%
[11-0] # pkg inf FreeBSD-ftpd
freebsd-ftpd-20240719
Name           : freebsd-ftpd
Version        : 20240719
Installed on   : Sun Aug 10 12:13:39 2025 CEST
Origin         : ftp/freebsd-ftpd
Architecture   : FreeBSD:14:amd64
Prefix         : /usr/local
Categories     : ftp
Licenses       : BSD3CLAUSE
Maintainer     : cy@FreeBSD.org
WWW            : https://github.com/cschuber/freebsd-ftpd

What output do you get with pkg version -qvRL= -n FreeBSD-ftpd ?
I get:
Code:
[50-0] # pkg version -qvRL= -n freebsd-ftpd
[51-0] # echo $?
0
[52-0] # pkg version -qvRL= -n FreeBSD-ftpd
[53->1<] # echo $?
1
[54-0] #
 
OK, I got it. There is somewhat a conflict between base and ports.

Code:
[12:22][fmc000@tu45b-freebsd ~]$ pkg search freebsd-ftpd
freebsd-ftpd-20240719          FreeBSD ftpd
FreeBSD-ftpd-14.3p2            FTP Daemon
FreeBSD-ftpd-dbg-14.3p2        FTP Daemon (Debugging Symbols)
FreeBSD-ftpd-man-14.3p2        FTP Daemon (Manual Pages)
[12:24][fmc000@tu45b-freebsd ~]$

and this is tricking pkg version -qvRL=. It looks like this happens with pkgbase only.
 
It seems like, for ftpd at least, this case-sensitivity issue will get less confusing in 15 when ftpd is removed from the base system.

FTPD(8) FreeBSD System Manager's Manual FTPD(8)

NAME
ftpd – Internet File Transfer Protocol server

SYNOPSIS
ftpd [-468ABDdEhMmOoRrSUvW] [-l [-l]] [-a address] [-P port] [-p file]
[-T maxtimeout] [-t timeout] [-u umask]

DEPRECATION NOTICE
The FreeBSD base system ftpd is deprecated, and will be removed in
FreeBSD 15.0. Users are advised to install the ftp/freebsd-ftpd port or
package instead.

Will pkgbase and pkg (ports) have distinct name spaces, and not just for case-sensitive matching? I think I'd find it easier if searches were case-sensitive _and_ pkg warned me where there is a clash of names, when using case-insensitive matching.
 
Well, what output comes from pkg version -qvRL= -n FreeBSD-ftpd ?
Same:

Code:
[12:24][fmc000@tu45b-freebsd ~]$ pkg version -qvRL= -n FreeBSD-ftpd
FreeBSD-ftpd-14.3p2                <   needs updating (remote has 20240719)
[13:26][fmc000@tu45b-freebsd ~]$

It seems like, for ftpd at least, this case-sensitivity issue will get less confusing in 15 when ftpd is removed from the base system.

Maybe this is why this wasn't noticed until now.
 

Attachments

  • 2025-08-10_15-34.png
    2025-08-10_15-34.png
    50.3 KB · Views: 130
It looks like a typo to me. Did you try it?

Code:
[14:43][fmc000@tu45b-freebsd ~]$ mkdir test                                
[14:43][fmc000@tu45b-freebsd ~]$ doas chmod 41777 test                                                        
chmod: invalid file mode: 41777
[14:43][fmc000@tu45b-freebsd ~]$

Even if you give ALL the possible permissions (i.e. sticky, suid, sgid) you still get to 7777

Code:
[14:45][fmc000@tu45b-freebsd ~]$ doas chmod 7777  test  
[14:45][fmc000@tu45b-freebsd ~]$ ls -la test      
total 33
drwsrwsrwt   2 fmc000 fmc000  2 Aug 10 14:43 .
drwxr-xr-x+ 30 fmc000 fmc000 59 Aug 10 14:45 ..
[14:45][fmc000@tu45b-freebsd ~]$
 
It looks like a typo to me. Did you try it?

Code:
[14:43][fmc000@tu45b-freebsd ~]$ mkdir test                               
[14:43][fmc000@tu45b-freebsd ~]$ doas chmod 41777 test                                                       
chmod: invalid file mode: 41777
[14:43][fmc000@tu45b-freebsd ~]$

Even if you give ALL the possible permissions (i.e. sticky, suid, sgid) you still get to 7777

Code:
[14:45][fmc000@tu45b-freebsd ~]$ doas chmod 7777  test 
[14:45][fmc000@tu45b-freebsd ~]$ ls -la test     
total 33
drwsrwsrwt   2 fmc000 fmc000  2 Aug 10 14:43 .
drwxr-xr-x+ 30 fmc000 fmc000 59 Aug 10 14:45 ..
[14:45][fmc000@tu45b-freebsd ~]$
https://superuser.com/questions/669364/why-in-midnight-commander-the-chmod-has-5-digits-and-what-for
 

Sorry but I believe that link is totally pointless, these are the access modes, not what we're talking about here. As I showed you, FreeBSD chmod does fail on 5 digits argument. From the chmod(2) man page:

Code:
     A mode is created from or'd permission bit masks defined in <sys/stat.h>:

           #define S_IRWXU 0000700    /* RWX mask for owner */
           #define S_IRUSR 0000400    /* R for owner */
           #define S_IWUSR 0000200    /* W for owner */
           #define S_IXUSR 0000100    /* X for owner */

           #define S_IRWXG 0000070    /* RWX mask for group */
           #define S_IRGRP 0000040    /* R for group */
           #define S_IWGRP 0000020    /* W for group */
           #define S_IXGRP 0000010    /* X for group */

           #define S_IRWXO 0000007    /* RWX mask for other */
           #define S_IROTH 0000004    /* R for other */
           #define S_IWOTH 0000002    /* W for other */
           #define S_IXOTH 0000001    /* X for other */

           #define S_ISUID 0004000    /* set user id on execution */
           #define S_ISGID 0002000    /* set group id on execution */
           #define S_ISVTX 0001000    /* sticky bit */

     The non-standard S_ISTXT is a synonym for S_ISVTX.

I stick with the man page unless proven otherwise.

BTW, this is [OT] in this thread.
 
Sorry but I believe that link is totally pointless, these are the access modes, not what we're talking about here. As I showed you, FreeBSD chmod does fail on 5 digits argument. From the chmod(2) man page:

Code:
     A mode is created from or'd permission bit masks defined in <sys/stat.h>:

           #define S_IRWXU 0000700    /* RWX mask for owner */
           #define S_IRUSR 0000400    /* R for owner */
           #define S_IWUSR 0000200    /* W for owner */
           #define S_IXUSR 0000100    /* X for owner */

           #define S_IRWXG 0000070    /* RWX mask for group */
           #define S_IRGRP 0000040    /* R for group */
           #define S_IWGRP 0000020    /* W for group */
           #define S_IXGRP 0000010    /* X for group */

           #define S_IRWXO 0000007    /* RWX mask for other */
           #define S_IROTH 0000004    /* R for other */
           #define S_IWOTH 0000002    /* W for other */
           #define S_IXOTH 0000001    /* X for other */

           #define S_ISUID 0004000    /* set user id on execution */
           #define S_ISGID 0002000    /* set group id on execution */
           #define S_ISVTX 0001000    /* sticky bit */

     The non-standard S_ISTXT is a synonym for S_ISVTX.

I stick with the man page unless proven otherwise.

BTW, this is [OT] in this thread.
If are you using Midnight Commander (mc) check with it and you will see the same as USerID.
 
Back
Top