SAMBA digest 2030

Scott Ramey scottr at bdssoftware.com
Mon Mar 22 18:30:06 GMT 1999


> ------------------------------
> 
> Date: Mon, 22 Mar 1999 15:09:05 +0100
> From: sramirez at dimetronic.es
> To: samba at samba.org
> Subject: License Control in Samba - How to control opened files ?
> 
> Hi Samba World
> 
> I want to control the number of access (Open Operations) to a file to
> implement a License Control.
> 
> Cold I do this in samba with a option ? For example say that
> \apli\backup.exe will open only 7 times !!!
> 
> If with a samba option, I cannot do this, where can I modify or find the
> function that open files from disk to modify it ?
> 
> Regards
> 
> Santos Ramirez
> 
When I faced a similar problem in a multi-user app I wrote I did the
following.
I setup a file on the server in the directory where all application
data files are located and whenever a user starts the application up
from a workstation (or the server for what its worth) I add a record
to the file and lock it.  So, if there were four instances of the
application running there would be four locked records.  The record
included the workstation ID, date/time, and a user login name. 
During program initialization before the program writes and locks
the a new record it first reads through the file counting all the
currently locked records.  If the number of locked records exceeded
the number of licensed users an appropriate message is displayed and
the application terminates.  It's a kind of dumb solution to the
problem but it works.  If one of the instances of the application
bombs for whatever reason the record is automatically unlocked. 
Part of the logic of the startup process checks to see if there are
no locked records (meaning this is the only instance of my
application running) in which case the file is purged so it now only
contains one record, which keeps it from growing to an unseemly
size.  There's no guarantee this is hacker proof but it works and I
haven't had any problems with the 300+ sites using the multi-user
version of the application.

Regards,

Scott


More information about the samba mailing list