Shares messed up - how to fix?

Discussion in 'macOS' started by spidey3, Nov 18, 2010.

  1. spidey3 macrumors regular

    Joined:
    Jul 1, 2010
    #1
    The AFP and SMB shares provided by my machine (OSX 10.6.5) seem to be messed up.

    Specifically:
    1) There are shares which are visible from other machines which do not exist in System Preferences -> Sharing -> File Sharing
    2) There are share listed in System Preferences -> Sharing -> File Sharing which cannot be deleted

    How can this be cleaned up? What drives the set of shares? /var/db/samba/smb.shares is clearly a generated file. What generates it?

    Help!
     
  2. spidey3 thread starter macrumors regular

    Joined:
    Jul 1, 2010
    #2
    More detail:
    1) Many of the shares seem to all point to the same directory. This may have happened as I had to do a full restore from backup a few months ago, and re-arranged disks and some directories at that time
    2) I am running the regular OS (not Server).

    Spidey!!!
     
  3. spidey3 thread starter macrumors regular

    Joined:
    Jul 1, 2010
    #3
    Shares messed up - how to fix? [SOLVED!]

    Since I didn't see any responses, I spent a few more hours digging a little harder and found some info on this.

    See http://bit.ly/axvlFW for someone else who encountered a similar issue.

    The first thing I found is that if I had OSX Server, this would be easily resolved with the sharing command -- but alas, this command is not available outside the the Server OS...

    So I needed to do whatever sharing does manually.

    In short here was the process:
    1. FULL backup of boot disk - just in case I made things worse
    2. Shut down all sharing in User Preferences (Files, Printers, etc.)
    3. Use dscl to dip into Directory Service and delete the bogus sharepoints (under /Local/Default/SharePoints).
    4. When shares are created their access contol lists are managed as groups created with names like com.apple.sharepoint.group.n where n is some integer. These are in Directory Service under /Local/Default/Groups. Delete any which were associated only with the deleted groups, being careful not to touch any which are still referenced.
    5. Re-enable sharing
    6. Reboot
    7. Add back the correct set of shares using the "Shared Directory" checkbox in the file Get Info window
    It was really irritating to go through this pain -- but the issue now seems to be resolved.

    The good news is that I have now learned a lot about how SharePoints are represented in Directory Service. I am now contemplating what I might be able to do with this knowledge...

    Spidey!!!
     

Share This Page