Linux SMB helper: Difference between revisions

From SambaWiki
(Created page with "Category:CIFSclient There are too many knobs in different places at the moment: request-keys, idmap, cifscreds, /proc stuff. This goal of this project would be to write o...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
There are too many knobs in different places at the moment: request-keys, idmap, cifscreds, /proc stuff. This goal of this project would be to write one CLI tool that would wrap everything under a common interface. It could handle getting/setting ACL as well. Ideally this would replace and unify all the little tools in cifs-utils.
There are too many knobs in different places at the moment: request-keys, idmap, cifscreds, /proc stuff. This goal of this project would be to write one CLI tool that would wrap everything under a common interface. It could handle getting/setting ACL as well. Ideally this would replace and unify all the little tools in cifs-utils.


= Implementation =
I think it would be great to write this Python + a C python module for the syscalls and other ioctl which would not be so practical from python.

Alternatively, all in C++. I'm just tired of plain C for non-critical stuff. C + glib maybe.
In order of preference:
* Python + a C python module for the syscalls and other ioctl which would not be so practical from python.
* Alternatively, all in C++. I'm just tired of plain C for non-critical stuff
* C + glib maybe.
* Go/Rust: interesting but will need to be learned


= smbmount -- unified utility to manage linux smb mounts =
= smbmount -- unified utility to manage linux smb mounts =
Line 21: Line 26:


<pre># smbmount config</pre>
<pre># smbmount config</pre>




=== Debug ===
=== Debug ===
Line 87: Line 90:


<pre>
<pre>
# smbmount sid
# smbmount fileinfo
# smbmount acl
# smbmount acl
# smbmount streams
# smbmount streams
Line 98: Line 103:
<pre># smbmount show</pre>
<pre># smbmount show</pre>
* list things under "show"
* list things under "show"





Line 103: Line 109:
<pre># smbmount show connection [-v] [-f filters?]</pre>
<pre># smbmount show connection [-v] [-f filters?]</pre>
* list tcp con, sess, tcon (read DebugData)
* list tcp con, sess, tcon (read DebugData)





<pre># smbmount show mount [-v]</pre>
<pre># smbmount show mount [-v]</pre>
* list smb mount points with explained mount options
* list smb mount points with explained mount options





<pre># smbmount show stats [???]</pre>
<pre># smbmount show stats [???]</pre>

Latest revision as of 15:50, 14 February 2019


There are too many knobs in different places at the moment: request-keys, idmap, cifscreds, /proc stuff. This goal of this project would be to write one CLI tool that would wrap everything under a common interface. It could handle getting/setting ACL as well. Ideally this would replace and unify all the little tools in cifs-utils.

Implementation

In order of preference:

  • Python + a C python module for the syscalls and other ioctl which would not be so practical from python.
  • Alternatively, all in C++. I'm just tired of plain C for non-critical stuff
  • C + glib maybe.
  • Go/Rust: interesting but will need to be learned

smbmount -- unified utility to manage linux smb mounts

Mounting

# smbmount //UNC /path [opts]
# or
# smbmount mount //UNC /path [opts]

Configuration

list things under "config"

# smbmount config

Debug

smbmount config debug [on|off]
  • make cifs.ko verbose/quiet
  • do something with ftrace?
   echo 'module cifs +p' > /sys/kernel/debug/dynamic_debug/control
   echo 'file fs/cifs/* +p' > /sys/kernel/debug/dynamic_debug/control
   echo 1 > /proc/fs/cifs/cifsFYI
   echo 1 > /sys/module/dns_resolver/parameters/debug

Trace

# smbmount config trace [on|off|???]
  • get/set traceSMB
  • should this be in "config debug"?

DNS

# smbmount config dns
# smbmount config dns cache
  • list entries
# smbmount config dns cache clear
  • clear cache
# smbmount config dns cache expire [time]
  • get/set expire time

DFS

# smbmount config dfs
# smbmount config dfs cache
  • list entries
# smbmount config dfs clear
  • clear cached entries

Credentials

XXX: is "auth" better?

# smbmount config credentials
  • allow to dump/edit in-kernel credentials
  • TODO: this might require kernel changes
  • we could entirely use the keyctl system for creds
  • usecase: password expire or changes and you want to let cifs.ko reconnect without unmount/remounting
# smbmount config kerberos
  • kerberos things
  • TODO: what exactly? figure out what this should include. tickets have to be renewed? how? etc
  • XXX: should this go under "credentials"?

SMB-specific file opts

We would have a verb per operation

# smbmount sid
# smbmount fileinfo
# smbmount acl
# smbmount streams
# smbmount setattr
# smbmount ...
  • TODO: complete

Global information

# smbmount show
  • list things under "show"



# smbmount show connection [-v] [-f filters?]
  • list tcp con, sess, tcon (read DebugData)



# smbmount show mount [-v]
  • list smb mount points with explained mount options



# smbmount show stats [???]
  • compile and list various stats from /proc/fs/cifs