On Mon, Nov 05, 2001 at 08:00:11PM -0500, Peter Nikolla wrote:
I am tiring to right a locking mechanism for my program. I wanted to find something unique on a Linux/Unix system that I could read to lock my code to that machine. Does anyone know of a call I can make to get an unique ID like a disk ID, or system ID?
I'll agree with Keith on this one, it's fairly impossible to do if you're doing software-only, and probably isn't a good idea anyway. All you'll end up doing is ticking people off as they change system information around on you to bypass the "copy protection". Even semi-devious tricks like locking on root filesystem UUID (which I think would be cool to play with once or twice but not actually use for real code) can be easily fooled by something like tune2fs, if the underlying filesystem has UUIDs at all (ext[23] and XFS do, but does JFS, reiser, etc?) Typically, software tries to lock on hostid, but that's manually changable on every platform I can think of, and since PCs don't have the extra chips for hostid, it's generated in software for Linux/BSD/etc for extra-easy changing. The hostid on some platforms (SPARCs specifically here) are some algorithmic version of the main ethernet controller's MAC address. But that's changable as well via ifconfig. Why are you trying to do this for anyway? Unless your software is so critical that its functions can't be done elsewhere, I think you'll find that most people will see the "lock" business as a reason to not buy the software. -- Randomly Generated Tagline: "Flourescent lights are generating negative ions." - Today's BOFH Excuse