Bug 15628 - json output for smbclient
Summary: json output for smbclient
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-10 18:45 UTC by bandabasotti
Modified: 2024-04-10 18:45 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bandabasotti 2024-04-10 18:45:10 UTC
Currently, smbclient provides an interface similar to that of the ftp program, allowing users to interact with SMB/CIFS resources on servers. However, it lacks native support for output in JSON format.Currently, smbclient provides an interface similar to that of the ftp program, allowing users to interact with SMB/CIFS resources on servers. However, it lacks native support for output in JSON format, scripts rely on JSON for structured data exchange. Having JSON output from smbclient would greatly enhance its usability in various scenarios.
I’ve included sample output in JSON format based on the current smbclient output. These examples demonstrate how the proposed enhancement could benefit users:

List Shares on a Server:

{
    "server": "myserver",
    "shares": [
        {
            "name": "share1",
            "type": "disk",
            "comment": "Shared folder for project files"
        },
        {
            "name": "share2",
            "type": "printer",
            "comment": "Printer queue"
        }
    ]
}

Retrieve File Information:

{
    "file": "example.txt",
    "size": 1024,
    "last_modified": "2024-04-10T14:30:00Z",
    "permissions": "rw-r--r--"
}

Please consider implementing this feature to enhance the versatility of smbclient.
If you need further clarification or have any questions, feel free to reach out.
Thank you for your attention to this matter. I appreciate your efforts in maintaining and improving samba.