How to Vary Module Path Based on User

Bill at 83 North bill at 83north.com
Wed Jan 3 05:15:50 GMT 2007


I want to vary the path rsync uses based on the user that authenitcated to the module.

I can see doing this in one of two ways:

1)  Append the username that was used for the connection to the path string of the module on the fly.  What was /path/to/dir is now /path/to/dir/username

2)  Append the username into the dest_path that was sent from the other side.  The effect of this would do the same thing for me - instead of changing the module path, it would in effect, simply look like the far end had specified an extra directory.  

What was  test at server.com::Module/directory is now test at server.com::Module/username/directory

I want to do this to facilitate having multiple logins use one module to store data.  I am using a gui on the far end that autolists the available modules.  I want it to be as simple as to select the one available module, enter the correct username and password, and have your files go to the right place.  I don't want to recompile the gui, I'd rather make the magic happen on the rsyncd end.

Is there a function in rsync that does this?  Is there an ability to use the pre transfer execute to modify a variable to make that happen?

I've been playing in main.c attempting to hard code something to work just for me, but I'd prefer to use something that was actually meant for the task.

Thanks,
Bill Gade
83 North Inc.
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the rsync mailing list