Quota support

There already exists some quota support for samba both on client side and server side.

  • On the client side there is the smbcquota tool, afaics this only works using SMB1 (or at least I only ever saw it working with smb1, I don't see any cmdline switches to change it)
  • On the server side there is support for scripts and/or ability to hook into standard linux system quota api(s) if they exist

From the windows client you can additionally manage the quotas (with the appropriate user e.g. Administrator privileged user on windows or root to manage a linux share).

This all seems to work fine as long as you are using SMB1, using SMB2 and it falls down, it seems there are some missing pieces, at least a SMB2_QUERY_INFO message with class SMB2_GETINFO_QUOTA (and I guess the equivalent SETINFO) don't seem to be implemented. Also SMB2_QUERY_INFO message with class FS_INFO & level FileFsControlInformation fails for the special Quota stream '\$Extend\$Quota:$Q:$INDEX_ALLOCATION'

Additionally wireshark doesn't dissect the SMB2_QUERY_INFO message with class SMB2_GETINFO_QUOTA request (or associated response) so it isn't even clear what information being passed back and forth with normal windows traffic

Goals

  • firstly improve the existing SMB2 wireshark dissector to try and parse the missing quota related information
  • use the info above to try and get SMB2 quota related communication running (to allow remote get/set/list of quota limits from windows client against a linux samba share)
  • try and port (or just add support for SMB2) to smbcquota tool

Looking for hackers with the skills:

Nothing? Add some keywords!

This project is part of:

Hack Week 15

Activity

  • almost 8 years ago: npower originated this project.

  • Comments

    • npower
      almost 8 years ago by npower | Reply

      Some parts I found were already implemented when I started to actually look into the implementation (and using master versions of wireshark and samba) But.. at least I managed to get the smb2 related messages working (and learned a bit along the way) here are the patches. Additionally I reworked the patches, also rewrote the smb1 code to share common code and replaced most of the hand coded mashall/unmarshall routines with ndr generated code. I posted the code upstream for review

    Similar Projects

    This project is one of its kind!