Xref: utzoo comp.unix.programmer:2156 comp.lang.c:40532 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!ucla-cs!ucivax!orion.oac.uci.edu!ucsd!network.ucsd.edu!keynes.ucsd.edu!pbiron From: pbiron@keynes.ucsd.edu (Paul Biron) Newsgroups: comp.unix.programmer,comp.lang.c Subject: Re: methods for putting labels into your software? Keywords: RCS Message-ID: <5511@network.ucsd.edu> Date: 27 Jun 91 14:45:10 GMT References: <1991Jun26.165609.9692@athena.mit.edu> Sender: news@network.ucsd.edu Followup-To: comp.unix.programmer Distribution: usa Organization: Department of Economics, UCSD Lines: 34 Nntp-Posting-Host: keynes.ucsd.edu In article <1991Jun26.165609.9692@athena.mit.edu> mlevin@jade.tufts.edu writes: > > I'd like to hear suggestions, or any tricks that the pros out there >know about, for putting some kind of text label or code into your >executable (compiled and linked from C code) so that if anyone were to >copy a part of the code, you could know it was a copy by somehow >seeking out that label. For example, I guess you could probably define >a static string in your C program which contained a code word, and >then you could know if a given program was copied from yours by >doing "strings a.out | grep keyword" or something. I am looking for >ideas that are less obvious to detect - a method such that someone >copying the code wasn't likely to notice and edit out (with a patch or >something). Any ideas would be appreciated. > >Mike Levin How about just using rcs(1L) and ident(1L). rcs allows you put "labels" into to code which are initialized to a character string and are accessable in the binary with the ident command. Basically you put something like: static char *id = "$Source$" ; into your source file, and then when you check something out with rcs, it substitutes for $Source$ something like: static char *id = "$Source: /u3/ssdb/pbiron/src/Nssdb/RCS/main.c,v $" ; Then, when you run ident on the binary, it outputs: $Source: /u3/ssdb/pbiron/src/Nssdb/RCS/main.c,v $ You can get the rcs suite from uunet.