Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Enzo Matsumiya <ematsumiya@suse.de>
To: linux-cifs@vger.kernel.org, linkinjeon@kernel.org
Cc: senozhatsky@chromium.org, sergey.senozhatsky@gmail.com,
	hyc.lee@gmail.com, smfrench@gmail.com,
	Enzo Matsumiya <ematsumiya@suse.de>
Subject: [PATCH 0/9] Unify all programs into a single binary "ksmbdctl"
Date: Sun,  6 Mar 2022 22:33:35 -0300	[thread overview]
Message-ID: <20220307013344.29064-1-ematsumiya@suse.de> (raw)

Hello,

This commit unifies all existing programs
(ksmbd.{adduser,addshare,control,mountd}) into a single ksmbdctl binary.

The intention is to make it more like other modern tools (e.g. git,
nvme, virsh, etc) which have more clear user interface, readable
commands, and also makes it easier to script.

Example commands:
  # ksmbdctl share add myshare -o "guest ok=yes, writable=yes, path=/mnt/data"
  # ksmbdctl user add myuser
  # ksmbdctl user add -i $HOME/mysmb.conf anotheruser
  # ksmbdctl daemon start

Besides adding a new "share list" command, any previously working
functionality shouldn't be affected.

Basic testing was done manually.

TODO:
- run more complex tests in more complex environments
- implement unit tests (for each command and subcommand)
- create an abstract command interface, to make it easier to add/modify
  commands

Enzo Matsumiya (9):
  ksmbd-tools: rename dirs to reflect new commands
  ksmbd-tools: move control functions to daemon
  ksmbd-tools: use quotes for local includes
  share: introduce share_cmd
  user: introduce user_cmd
  daemon: introduce daemon_cmd
  daemon/rpc_samr: drop unused function rpc_samr_remove_domain_entry()
  Unify all programs into a single binary "ksmbdctl"
  README: change to markdown, updates for ksmbdctl

 Makefile.am                        |  14 +-
 README                             | 100 -------
 README.md                          |  57 ++--
 addshare/addshare.c                | 172 -------------
 addshare/share_admin.h             |  15 --
 adduser/adduser.c                  | 180 -------------
 adduser/user_admin.h               |  15 --
 configure.ac                       |   7 +-
 control/Makefile.am                |   7 -
 control/control.c                  | 128 ---------
 {mountd => daemon}/Makefile.am     |   2 +-
 mountd/mountd.c => daemon/daemon.c | 401 +++++++++++++++++++++--------
 daemon/daemon.h                    |  55 ++++
 {mountd => daemon}/ipc.c           |  27 +-
 {mountd => daemon}/rpc.c           |  21 +-
 {mountd => daemon}/rpc_lsarpc.c    |  13 +-
 {mountd => daemon}/rpc_samr.c      |  22 +-
 {mountd => daemon}/rpc_srvsvc.c    |  11 +-
 {mountd => daemon}/rpc_wkssvc.c    |  10 +-
 {mountd => daemon}/smbacl.c        |   4 +-
 {mountd => daemon}/worker.c        |  32 +--
 include/config_parser.h            |   2 +-
 include/ksmbdtools.h               |  24 +-
 ksmbdctl.c                         | 182 +++++++++++++
 lib/config_parser.c                |  15 +-
 lib/ksmbdtools.c                   |  26 +-
 lib/management/spnego.c            |   6 +-
 lib/management/spnego_krb5.c       |   4 +-
 {addshare => share}/Makefile.am    |   2 +-
 share/share.c                      | 227 ++++++++++++++++
 {addshare => share}/share_admin.c  |  97 +++++--
 share/share_admin.h                |  44 ++++
 {adduser => user}/Makefile.am      |   2 +-
 {adduser => user}/md4_hash.c       |   2 +-
 {adduser => user}/md4_hash.h       |   0
 user/user.c                        | 238 +++++++++++++++++
 {adduser => user}/user_admin.c     | 263 ++++++++++---------
 user/user_admin.h                  |  44 ++++
 38 files changed, 1458 insertions(+), 1013 deletions(-)
 delete mode 100644 README
 delete mode 100644 addshare/addshare.c
 delete mode 100644 addshare/share_admin.h
 delete mode 100644 adduser/adduser.c
 delete mode 100644 adduser/user_admin.h
 delete mode 100644 control/Makefile.am
 delete mode 100644 control/control.c
 rename {mountd => daemon}/Makefile.am (95%)
 rename mountd/mountd.c => daemon/daemon.c (55%)
 create mode 100644 daemon/daemon.h
 rename {mountd => daemon}/ipc.c (95%)
 rename {mountd => daemon}/rpc.c (98%)
 rename {mountd => daemon}/rpc_lsarpc.c (98%)
 rename {mountd => daemon}/rpc_samr.c (98%)
 rename {mountd => daemon}/rpc_srvsvc.c (98%)
 rename {mountd => daemon}/rpc_wkssvc.c (97%)
 rename {mountd => daemon}/smbacl.c (99%)
 rename {mountd => daemon}/worker.c (95%)
 create mode 100644 ksmbdctl.c
 rename {addshare => share}/Makefile.am (74%)
 create mode 100644 share/share.c
 rename {addshare => share}/share_admin.c (68%)
 create mode 100644 share/share_admin.h
 rename {adduser => user}/Makefile.am (69%)
 rename {adduser => user}/md4_hash.c (99%)
 rename {adduser => user}/md4_hash.h (100%)
 create mode 100644 user/user.c
 rename {adduser => user}/user_admin.c (52%)
 create mode 100644 user/user_admin.h

-- 
2.34.1


             reply	other threads:[~2022-03-07  1:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07  1:33 Enzo Matsumiya [this message]
2022-03-07  1:33 ` [PATCH 1/9] ksmbd-tools: rename dirs to reflect new commands Enzo Matsumiya
2022-03-07  1:33 ` [PATCH 2/9] ksmbd-tools: move control functions to daemon Enzo Matsumiya
2022-03-07  1:33 ` [PATCH 3/9] ksmbd-tools: use quotes for local includes Enzo Matsumiya
2022-03-07  1:33 ` [PATCH 4/9] share: introduce share_cmd Enzo Matsumiya
2022-03-10  2:19   ` Namjae Jeon
2022-03-07  1:33 ` [PATCH 5/9] user: introduce user_cmd Enzo Matsumiya
2022-03-10  2:17   ` Namjae Jeon
2022-03-07  1:33 ` [PATCH 6/9] daemon: introduce daemon_cmd Enzo Matsumiya
2022-03-07  1:33 ` [PATCH 7/9] daemon/rpc_samr: drop unused function rpc_samr_remove_domain_entry() Enzo Matsumiya
2022-03-07  1:33 ` [PATCH 8/9] Unify all programs into a single binary "ksmbdctl" Enzo Matsumiya
2022-03-07  1:33 ` [PATCH 9/9] README: change to markdown, updates for ksmbdctl Enzo Matsumiya
2022-03-10  2:11 ` [PATCH 0/9] Unify all programs into a single binary "ksmbdctl" Namjae Jeon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220307013344.29064-1-ematsumiya@suse.de \
    --to=ematsumiya@suse.de \
    --cc=hyc.lee@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=senozhatsky@chromium.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=smfrench@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox