summaryrefslogtreecommitdiff
path: root/source3/utils/status.c
AgeCommit message (Collapse)AuthorFilesLines
2025-08-22smbd: Make a few encryption-related functions static to smbstatusVolker Lendecke1-0/+32
Only referenced there, I got confused by them being part of smbd Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-04-09s3/locking: remove now unused private_options from share_mode_entryRalph Boehme1-2/+2
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-09s3/locking: store NTCREATEX_FLAG_DENY_[DOS|FCB] as share_entry_flagsRalph Boehme1-4/+4
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-11-05s3/locking: add share_entry_forall_read() and share_entry_forall() varientsRalph Boehme1-1/+1
All existing callers use share_entry_forall_read, so no change in behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15608 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-05-23s3:utils: let smbstatus report anonymous signing/encryption explicitlyStefan Metzmacher1-0/+28
We should mark sessions/tcons with anonymous encryption or signing in a special way, as the value of it is void, all based on a session key with 16 zero bytes. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15412 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu May 23 13:37:09 UTC 2024 on atb-devel-224
2024-05-23s3:utils: let smbstatus also report partial tcon signing/encryptionStefan Metzmacher1-7/+41
We already do that for sessions and also for the json output, but it was missing in the non-json output for tcons. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15412 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2024-05-23s3:utils: let smbstatus also report AES-256 encryption types for tconsStefan Metzmacher1-0/+6
We already do that for sessions. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15412 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2023-08-23s3:utils: Use lpcfg_set_cmdline() in smbstatusPavel Kalugin1-1/+4
Signed-off-by: Pavel Kalugin <pkalugin@inno.tech> Reviewed-by: Andreas Schneider <asn@samba.org>
2023-05-24s3:utils: Check return value of json_new_object()Joseph Sutton1-1/+3
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-02-02s3:utils: Fix UNUSED_VALUEPavel Filipenský1-2/+0
Reported by RedHat internal Covscan Since cb8a0d9 we no longer stop traversing the list if encryption_flag or signing_flags are unknown. Assignment "result = -1;" is always overwritten by "result = traverse_connections_*()" and is a dead code. Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Feb 2 15:46:52 UTC 2023 on atb-devel-224
2023-02-02s3:utils: Fix trailing whitespacesPavel Filipenský1-5/+5
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-11s3:smbstatus: go to cmdline_messaging_context_freeJones Syue1-1/+2
If the locking.tdb is not found, (for example, fresh new installed samba server is not running yet) smbstatus utility would exit earlier, and lock files are left behind in the directory 'msg.sock' and 'msg.lock'. Consider that a script to run smbstatus utility in a loop, this might result in used space slowly growing-up on the underlying filesystem. Since the samba server is not running yet, there is no cleanupd daemon could delete these files to reclaim space. Supposed to use 'ret = 0; goto done;' instead of exit(0), this would go through the cmdline_messaging_context_free() which deletes the lock files in the directory msg.sock and msg.lock before smbstatus utility is exiting. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15282 Signed-off-by: Jones Syue <jonessyue@qnap.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Jan 11 17:08:10 UTC 2023 on sn-devel-184
2023-01-10lib: Make map_share_mode_to_deny_mode() static to smbstatusVolker Lendecke1-0/+22
At some point in the future this might disappear, we should really not show DOS share modes in smbstatus. Maybe this can't be changed though. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-08smbstatus: add JSON support for smbstatus --profileJule Anger1-4/+9
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add JSON support for smbstatusJule Anger1-5/+31
Adds the option --json for all informations except the profiling. With --json sets the json_output variable to true, so that the json dictionary can be created and printed. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add server_id to notifiesJule Anger1-1/+1
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add a notifies dictionaryJule Anger1-7/+18
Adds an empty json dictionary under the key "notifies" and adds foreach notify a dictionary with information to the notify dictionary. Uses the pid as key. Only print to stdout, if json_output is not set. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add file_id information to byte-range locks in json outputJule Anger1-0/+1
Adds a dictionary with file_id information (devid, inode and extid) for each byte-range locked file. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add locks to byte-range locked files in json outputJule Anger1-0/+4
At the moment, there is only information about the byte-range locked files. Adds a list of its locks for each file. An open is represented as a dictionary. Contains all information (pid, dev_inode, read_write, start and size) about the lock. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add server_id to byte-range locksJule Anger1-0/+1
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add a basic byte-range locks dictionaryJule Anger1-11/+21
Adds an empty json dictionary under the key "byte_range_locks" and adds foreach locked file a dictionary with information (path and filename) to the byte-range locks dictionary. Only print to stdout, if json_output is not set. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add service path to byte-range locksJule Anger1-0/+1
The service/share path was added in 39ddd0a520bc and removed in 3a7d372e2eb5. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add server_id to open files dictionaryJule Anger1-1/+0
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add lease information about open files to json outputJule Anger1-1/+2
Adds a dictionary named "lease" to a opens dictionary. If leases are used, the dictionary contains a boolean for each type (READE, WRITE and HANDLE or UNKNOWN) and a string representation of the lease. Otherwise the dict is left empty. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add oplock information about open files to json outputJule Anger1-0/+1
Adds a dictionary named "oplock" to a opens dictionary. Contains a string representation and booleans for each oplock type (EXCLUSIVE, BATCH, LEVEL_II, LEASE). Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add opens to files in json outputJule Anger1-0/+3
At the moment, there is only information about the open files. Adds a list of its opens for each file. An open is represented as a dictionary. Contains only the basic information (pid, uid and time) about the open. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add file_id information about open files to json outputJule Anger1-0/+1
Adds a dictionary with file_id information (devid, inode and extid) for each locked file. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add a basic dictionary with open filesJule Anger1-13/+23
Adds an empty json dictionary under the key "open_files" and adds foreach locked file a dictionary with information (path, filename and pending deletes) to the locked files dictionary. Uses path and filename as key. Only print to stdout, if json_output is not set. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add encryption and signing to sessionsJule Anger1-0/+4
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add a sessions dictionaryJule Anger1-14/+33
Adds an empty json dictionary under the key "sessions" and adds foreach session a dictionary with information to the session dictionary. Uses the session_id as key. uid_str and gid_str are needed because both receive their own JSON field. Only print to stdout, if json_output is not set. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add encryption and signing to connectionsJule Anger1-1/+9
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08conn_tdb: change type of connections_data.start to NTTIMEJule Anger1-1/+1
connections_data.start previously had the type time_t, but time_t only had a precision for seconds. NTTIME has a higer precision, which is useful for debugging. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add a connections dictionaryJule Anger1-11/+19
Adds an empty json dictionary under the key "tcons" and adds foreach connection a dictionary with information to the shares dictionary. Only print to stdout, if json_output is not set. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add general information to the json outputJule Anger1-0/+1
Adds timestamp, samba version and path to smb.conf to a given json object. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add json items to traverse_structJule Anger1-0/+11
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add frame files for json specific methodsJule Anger1-0/+1
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: use new enum crypto_degreeJule Anger1-44/+39
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: move the output of the content to their own methodsJule Anger1-42/+128
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: move the output of the title lines to their own methodsJule Anger1-14/+56
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: pass the traverse_state to the traverse methodsJule Anger1-12/+30
The state cannot be used as a context, so a NULL context tmp_ctx must be created. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add struct traverse_stateJule Anger1-3/+6
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: use variables in print_share_mode instead of printing directlyJule Anger1-32/+79
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: print errors to stderr instead of stdoutJule Anger1-14/+15
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: delete wrong EXCLUSIVE+BATCH oplockJule Anger1-5/+2
It is not possible to have an EXCLUSIVE+BATCH oplock, because a BATCH oplock includes an EXCLUSIVE oplock. Therefore, an EXCLUSIVE+BATCH-Oplock and a BATCH-Oplock are the same thing. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-06-10spelling: connnect encrytion exisit expection explicit invalide missmatch ↵Michael Tokarev1-3/+3
paramater paramter partion privilige relase reponse seperate unkown verson authencication progagated Tree-wide spellcheck for some common misspellings. source3/utils/status.c has misspelled local variable (unkown_dialect). "missmatch" is a known historical misspelling, only the incorrect misspellings are fixed. source3/locale/net/de.po has the spelling error (unkown) in two msgids - it probably should be updated with current source. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-11-11smbd: Remove unused "struct connections_key"Volker Lendecke1-2/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-09-10smbstatus: don't ignore unknown optionsRalph Boehme1-0/+5
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14828 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2021-07-15s3:smbstatus: pretty print the use of new signing/encryption algorithmsStefan Metzmacher1-15/+60
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-05-25s3:utils: Migrate smbstatus to new cmdline option parserAndreas Schneider1-24/+33
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-01-05s3:utils - explicitly free cmdline_messaging_contextAndrew Walker1-0/+1
Some command line utilities do not free their messaging context which results in extra entries being left in the msg.lock directory. Signed-off-by: Andrew Walker <awalker@ixsystems.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jan 5 21:30:08 UTC 2021 on sn-devel-184