bright, fresh software
Downloads  |  Buy

offline activation status [Solved]

offline activation status [Solved]

Postby msofer » December 6th, 2011, 11:38 am

I have been playing with TurboActivate on linux and found a small problem: likely my error, but possibly a bug.

I start my test and activate the license. IsActivated shows that it is activated, IsGenuine that everything is OK. I then disconnect my machine from the net: IsActivated still shows that the license is activated, IsGenuine return TA_E_INET: all is fine.

I stop my test program, and start it again without a net connection. Now things do not work as I thought they would:
- IsActivated returns non-TA_OK
- IsGenuine returns TA_FAIL
If I connect the net at this point, things fall back to "normal" and stay there.

Am I misusing the library? How can a find if the license has been activated if there is no network at the time of the first call to IsActivated? Related question: where is the activated-or-not status stored when the app exits?
msofer
 
Posts: 3
Joined: December 6th, 2011, 11:01 am

Re: offline activation status

Postby Wyatt » December 6th, 2011, 12:26 pm

Hey Miguel,

- IsActivated returns non-TA_OK


What exactly does it return -- TA_FAIL?


How can a find if the license has been activated if there is no network at the time of the first call to IsActivated?


IsActivated() doesn't require an internet connection, so you can use that.


Am I misusing the library?


I'd need to see the code you're using to know for sure. You can either post it here, or if it's a big chuck of code you can send it to me at wyatt@wyday.com and I'll take a look at it.



Related question: where is the activated-or-not status stored when the app exits?


It depends on what value you used for the "flags" parameter when calling CheckAndSavePKey(). If you call it with TA_USER then the cryptographically signed activation block is stored in "~/.local/", if you used TA_SYSTEM the signed block is stored in "/var/lib/.local/.".
User avatar
Wyatt
Site Admin
 
Posts: 2559
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: offline activation status

Postby msofer » December 6th, 2011, 2:49 pm

This is the implementation of a Tcl-command 'isActivated':

static int
TAtcl_isActivated(
ClientData clientData, /* unused */
Tcl_Interp *interp, /* Current interpreter */
int objc, /* Number of arguments */
Tcl_Obj *const objv[] /* Argument strings */
)
{
int ok;

if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
}
TAtcl_GUID(interp); /* just checks that the GUID has been stored in a global */

ok = IsActivated(GUID);
Tcl_SetObjResult(interp, Tcl_NewIntObj(ok == TA_OK));
fprintf(stdout, "Result was %i\n", ok);
return TCL_OK;
}

When I run this with an activated license and no net, I see:

mig@mtp:~/activation$ tclsh
% source initLime.tcl
lime(guid) = xxx
lime(key) = xxx
/home/mig/activation/limeLM_data/TurboActivate.dat
% isActivated
Result was 1 << TA_FAIL
0
% # turn on networking here!
% isActivated
Result was 0 << TA_OK
1
msofer
 
Posts: 3
Joined: December 6th, 2011, 11:01 am

Re: offline activation status

Postby Wyatt » December 6th, 2011, 4:25 pm

If I were to guess, I would say you're disabling or removing the ethernet device and that's what's causing the error. That is, the operating system no longer "sees" the ethernet or wireless hardware.

To test "offline mode" try unplugging your router instead (or unplugging your ethernet cord).

Tell me if that works.
User avatar
Wyatt
Site Admin
 
Posts: 2559
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: offline activation status

Postby msofer » December 7th, 2011, 7:49 am

That was a good guess, not 100% right though :)

I am connected to a wifi net, the computer has also an eth interface - enabled, but not connected to anything. Running NetworkManager from ubuntu repos.

1. If I just "disconnect" using the applet, behaviour is as I showed first. The OS sees both eth0 and wlan interfaces, but there is no ip assigned to any of them. The routing table is empty

2. If I unplug my wifi router, same deal

3. If I plug in my wifi router but disconnect it from the modem, behaviour is as should be. In other words, things work ok when the computer is actually connected to a network.
msofer
 
Posts: 3
Joined: December 6th, 2011, 11:01 am

Re: offline activation status

Postby Wyatt » December 7th, 2011, 9:59 am

I'll look into this behavior.
User avatar
Wyatt
Site Admin
 
Posts: 2559
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: offline activation status

Postby Wyatt » December 12th, 2011, 6:46 pm

OK, we've fixed this for TurboActivate 3.1.1 out now (get it on your API page).
User avatar
Wyatt
Site Admin
 
Posts: 2559
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire


Return to LimeLM & TurboActivate Support