Coder Social home page Coder Social logo

Username based shares about smblibrary HOT 5 CLOSED

talaloni avatar talaloni commented on August 20, 2024
Username based shares

from smblibrary.

Comments (5)

TalAloni avatar TalAloni commented on August 20, 2024

Thanks,
This is technically possible, but the current API does not support it.
The server service named pipe ("srvsvc") that is responsible to return the list of shares is implemented as part of the "object store" layer, currently, this layer is not aware of the SMB layer (authentication).

Passing the UserName down to the server service, and replacing the share list with the actual FileSystemShare objects, will allow the service to check permissions on each share and list only those with at least Read permission. shouldn't be too hard, let me know if you need help with it.

from smblibrary.

ciamberlini avatar ciamberlini commented on August 20, 2024

Just as I imagined :-)
I'll do some testing, many thanks!

from smblibrary.

TalAloni avatar TalAloni commented on August 20, 2024

I have updated the current implementation: CreateFile now has a SecurityContext argument which contains the UserName, this is necessary for the object store, and was planned all along.

NamedPipeStore.CreateFile is the method that instantiates named pipes, so modifications should start there.

from smblibrary.

ciamberlini avatar ciamberlini commented on August 20, 2024

Strange, now it give me an error in NTFileSystemAdapter.GetFileInformation:
An unhandled exception of type 'System.InvalidCastException' occurred in SMBLibrary.dll
Additional information: Unable to cast object of type 'System.String' to type 'SMBLibrary.FileHandle'.

Handle object is empty string when the error occour.

from smblibrary.

TalAloni avatar TalAloni commented on August 20, 2024

Sorry about that! After I added the SecurityContext parameters there was one place that used an incorrect method overload that didn't trigger a compiler error. I have committed the fix.

from smblibrary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.