Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/9] Unify all programs into a single binary "ksmbdctl"
@ 2022-03-07  1:33 Enzo Matsumiya
  2022-03-07  1:33 ` [PATCH 1/9] ksmbd-tools: rename dirs to reflect new commands Enzo Matsumiya
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Enzo Matsumiya @ 2022-03-07  1:33 UTC (permalink / raw)
  To: linux-cifs, linkinjeon
  Cc: senozhatsky, sergey.senozhatsky, hyc.lee, smfrench,
	Enzo Matsumiya

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-03-10  2:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-07  1:33 [PATCH 0/9] Unify all programs into a single binary "ksmbdctl" Enzo Matsumiya
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox