[Bug 275597] Samba: smbd sometimes aborts by PANIC when 'vfs objects = cap'

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 23 Dec 2023 14:37:02 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275597

--- Comment #3 from uratan <uratan@miomio.jp> ---
I will close this topic with this.

/*
 * how to make samba4 from ports  (memorandum for me in the future)
 */                                 (and for those who got here)

[1] Extract files from freebsd-dist/ports.txz
  +------------------------------------------------------
  |# cd /
  |# tar xzf ...somewhere/freebsd-dist/ports.txz  usr/ports/net/samba416
  +------------------------------------------------------
    Also these files are needed to make samba416
  +------------------------------------------------------
  |# tar xzf ...somewhere/freebsd-dist/ports.txz  usr/ports/Keywords
  |# tar xzf ...somewhere/freebsd-dist/ports.txz  usr/ports/Mk
  |# tar xzf ...somewhere/freebsd-dist/ports.txz  usr/ports/Templates
  |# tar xzf ...somewhere/freebsd-dist/ports.txz  usr/ports/lang
  |# tar xzf ...somewhere/freebsd-dist/ports.txz  usr/ports/ports-mgmt
  +------------------------------------------------------

[2] Other preparations

    These packages were required additionally to make in my environment
      | p5-Parse-Yapp-1.21.pkg   | libtextstyle-0.22.pkg
      | cmocka-1.1.5.pkg         | bison-3.8.2,1.pkg
      | p5-JSON-4.10.pkg         | m4-1.4.19,1.pkg
      | pkgconf-2.0.3,1.pkg
    (I wonder... 'make' would have added them on during 'make'ing ?)

    The distfile: samba-4.16.11.tar.gz will be downloaded automatically
    but if you already have it, place it to /usr/ports/distfiles/

[3] Do (first) make
  +------------------------------------------------------
  |# cd /usr/ports/net/samba416
  |# make
  +------------------------------------------------------
    Then some configuration menu is appeared,
    simply select <Cancel> to choose/keep default settings
  +------------------------------------------------------
  |lqqqqqqqqqqqqqqqqqqqqqqqqqqq samba416-4.16.11 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
  |x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
  |x x+[x] ADS             Active Directory client(implies LDAP)            x x
  |x x+[x] AD_DC           Active Directory Domain Controller(implies PYTHONx x
  |x x+[ ] CLUSTER         Clustering support                               x x
  |x x+[ ] CUPS            CUPS printing system support                     x x
  |x x+[x] DOCS            Build and/or install documentation               x x
  |x x+[x] FAM             File Alteration Monitor                          x x
  |x x+[ ] GPGME           GpgME support                                    x x
  |x x+[x] LDAP            LDAP client                                      x x
  |x x+[ ] MANDOC          Build manpages from DOCBOOK templates            x x
  |x x+[x] PROFILE         Profiling data                                   x x
  |x x+[x] PYTHON3         Python 3.x bindings or support                   x x
  |x x+[x] QUOTAS          Disk quota support                               x x
  |x x+[ ] SPOTLIGHT       Spotlight server-side search support             x x
  |x x+[x] SYSLOG          Syslog logging support                           x x
  |x x+[x] UTMP            UTMP accounting                                  x x
  |x xqqqqqqqqqqqqqqqqqqqqqqqqqqqqq VFS modules qqqqqqqqqqqqqqqqqqqqqqqqqqqqx x
  |x mqqqqqv(+)qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq64%qqqqqj x
  |tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
  |x                       <  OK  >            <Cancel>                       x
  |mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
  +------------------------------------------------------

    It takes about 30min to finish in my environment,
    I've got same binary to samba416-4.16.11.pkg
  +------------------------------------------------------
  |# pwd
  |/usr/ports/net/samba416
  |
  |# ls -F
  |Makefile                pkg-descr               pkg-plist.cluster
  |distinfo                pkg-plist               pkg-plist.python
  |files/                  pkg-plist.ad_dc         work/
  |
  |# ls -F work/
  |.PLIST.mktmp                            .patch_done.samba416._usr_local
  |.build_done.samba416._usr_local         .stage_done.samba416._usr_local
  |.configure_done.samba416._usr_local     README.FreeBSD
  |.extract_done.samba416._usr_local       pkg-message
  |.license-catalog.mk                     samba-4.16.11/
  |.license-report                         samba_server
  |.license_done.samba416._usr_local       stage/
  |
  |# md5 -r work/stage/usr/local/sbin/smbd \
  |                   /usr/local/sbin/smbd
  |e281293697932aff5d3c32c211da3a4b work/stage/usr/local/sbin/smbd
  |e281293697932aff5d3c32c211da3a4b /usr/local/sbin/smbd
  +------------------------------------------------------

[4] How to make again after changing source codes
  +------------------------------------------------------
  |# pwd
  |/usr/ports/net/samba416
  |
  |# cd work/samba-4.16.11/
  |# vim source3/modules/vfs_cap.c
  |# cd ../../
  |
  |# make
  |  ...                        <-- do <Cancel> for the configuration menu
  |===> Options unchanged
  |#                            ... ???? NOTHING is DONE !!!!
  |
  |# ls -lrt work/
  |total 1
  |-rw-r--r--   1 root wheel     0 Dec 23 13:45
.extract_done.samba416._usr_local
  |-rw-r--r--   1 root wheel   215 Dec 23 13:45 .license-catalog.mk
  |-rw-r--r--   1 root wheel    93 Dec 23 13:45 .license-report
  |-rw-r--r--   1 root wheel     0 Dec 23 13:45
.license_done.samba416._usr_local
  |-rw-r--r--   1 root wheel     0 Dec 23 13:45 .patch_done.samba416._usr_local
  |-rw-r--r--   1 root wheel   958 Dec 23 13:45 pkg-message
  |-rw-r--r--   1 root wheel  3094 Dec 23 13:45 README.FreeBSD
  |-rw-r--r--   1 root wheel  8412 Dec 23 13:45 samba_server
  |drwxr-xr-x  36 root wheel  2048 Dec 23 13:49 samba-4.16.11
  |-rw-r--r--   1 root wheel     0 Dec 23 13:49
.configure_done.samba416._usr_local
  |-rw-r--r--   1 root wheel     0 Dec 23 14:13 .build_done.samba416._usr_local
  |drwxr-xr-x   4 root wheel   512 Dec 23 14:13 stage
  |-rw-r--r--   1 root wheel 52433 Dec 23 14:17 .PLIST.mktmp
  |-rw-r--r--   1 root wheel     0 Dec 23 14:17 .stage_done.samba416._usr_local
  |
  |# rm  work/.stage_done.samba416._usr_local \
  |      work/.build_done.samba416._usr_local
  |
  |# make
  |  ...                        <-- do <Cancel> for the configuration menu
  |===> Options unchanged
  |                             ... re-make started (takes 5min to finish)
  +------------------------------------------------------

[5] How to install samba4 of ports
  +------------------------------------------------------
  |# pkg info | fgrep samba4
  |samba416-4.16.11        Free SMB/CIFS and AD/DC server and client for Unix
  |# pkg delete samba416-4.16.11
  |
  |# pwd
  |/usr/ports/net/samba416
  |# make install
  |  ...                        <-- do <Cancel> for the configuration menu
  +------------------------------------------------------

[6] How to rollback to samba4 of packages
  +------------------------------------------------------
  |# pwd
  |/usr/ports/net/samba416
  |# make deinstall
  |
  |# pkg intall samba416-4.16.11
  +------------------------------------------------------

    you can confirm installation status from /var/log/messages
     | "pkg-static" means install/deinstall from ports
     | "pkg"        means install/delete    by pkg
  +------------------------------------------------------
  |# bzcat /var/log/messages.0.bz2 | fgrep pkg
           :                :
  |Dec 16 17:34:38 oxygen pkg-static[11504]: samba416-4.16.11 installed
  |Dec 16 18:27:13 oxygen pkg-static[39133]: samba416-4.16.11 deinstalled
  |Dec 16 18:27:27 oxygen pkg-static[39645]: samba416-4.16.11 installed
  |Dec 16 22:23:23 oxygen pkg-static[65811]: samba416-4.16.11 deinstalled
  |Dec 16 22:26:15 oxygen pkg[65987]: pkg upgraded: 1.20.8 -> 1.20.9
  |Dec 16 22:27:52 oxygen pkg[66699]: samba416-4.16.11 installed
  |Dec 16 23:00:40 oxygen pkg[81824]: samba416-4.16.11 deinstalled
  |Dec 16 23:01:17 oxygen pkg-static[82502]: samba416-4.16.11 installed
  |Dec 16 23:24:09 oxygen pkg-static[96335]: samba416-4.16.11 deinstalled
  |Dec 16 23:24:40 oxygen pkg-static[96976]: samba416-4.16.11 installed
  |Dec 17 00:01:49 oxygen pkg-static[13207]: samba416-4.16.11 deinstalled
  |Dec 17 00:02:39 oxygen pkg[13431]: samba416-4.16.11 installed
  |Dec 17 00:32:43 oxygen pkg[27009]: samba416-4.16.11 deinstalled
  |Dec 17 00:33:14 oxygen pkg-static[27678]: samba416-4.16.11 installed
  +------------------------------------------------------
            ... My smbd has been running great ever since!

 (Please let me know if there are any problems with the workflow)

-- 
You are receiving this mail because:
You are the assignee for the bug.