 |
| |  |
Home In This Issue Email a Friend EasyPrint
 | |
|
Coding Domino server tasks in C: the adventure continues (continued)
ACLHelp doesn't break the normal rules of Domino security because it only works if you have administrator's rights to the system. If you can't already shut the server down remotely, you can't run ACLHelp. In fact it would be a good addition to the standard administration tools. Hmmm…maybe I should start a petition on behalf of all administrators.
To run ACLHelp, you need to install the naclhelp.exe (for Windows) program in the server program directory. To run it, you type the following on the server console:
load aclhelp docs\mydb.nsf Ian Cherrill/4NF
|
You'll find that Ian Cherrill/4NF is now an unspecified manager in the ACL of the mydb.nsf database, located in the docs folder.
ACLHelp source code The source code can be found at http://www.4nf.co.uk/aclhelp, and you need to set up your compiler environment as described in last month's article. You must create the ACLHelp project and compile both the Win32 Debug and Win32 Release builds in MS Visual C++ 6.0 to make sure everything is working correctly.
By the way, if you're little confused by the error-handling code in these programs, you're not alone. When I first saw the following construct, I wondered what it meant:
if (error = NSFDbOpen (path, &hDb))
{
LogError (error);
return NOERROR;
}
|
Like a lot of C, there's a long way and a short way of writing the code. The error code returned is either zero (for no error) or a number relating to the problem. What the "if" statement does is execute the function and assign the error code to a variable called error and test the value of error all at once. And the statement:
is the same as:
So it could be written as:
error = NSFDbOpen (path, &hDb);
if (error != 0)
{
LogError (error);
return NOERROR;
}
|
This is definitely more readable. However, I've adopted the shorthand that Lotus uses, so don't blame me!
Stepping through Let's step through the ACLHelp program.
Build the code using the "Win32 Debug" as the active configuration. To run the program successfully, you must add some extra information to the Project Settings page under the Debug tab, as pictured in Figure A.
FIGURE A
You must add some extra information to the Project Settings page. Click picture for a larger image.
As you can see, under Working directory, you must specify "d:\notes" (or whatever your local Notes program directory is), and under Program arguments, you must specify "test.nsf, Mickey Mouse."
This tells the compiler to run the program from the Notes program directory (Domino server or Notes client) on your workstation. It also adds some test arguments that you would normally add on the console command line. Now in the Notes client, add a new database to match the program arguments called test.nsf using any design template you like. Check the ACL before you start so you know what's in it already.
[ Prev | Next ]
|
|
-- Advertisement --
PistolSTAR: the de facto standard for Lotus authentication
PistolStar's Password Power integrates with Microsoft Active Directory to enable single sign-on to Lotus applications and automatic recovery of the Notes ID password via self-service reset of the Active Directory password.
- A single set of credentials to remember - one set of password policies to manage.
- Cost-effective plug-ins integrate smoothly with your environment.
- Proven, ground-breaking technology deployed to millions of users.
Learn more. |
-- Advertisement --
Webinar: Agents Gone Wild! with Rocky Oliver & John Kingsley
We can all appreciate what agents can do for us when they're on our team, but how do you identify agents that aren't doing what they're supposed to be doing?
In this webinar we'll discuss tips to help you manage your agents more effectively, including ways to identify all of your agents, to give them the makeover they need, locate agents with errors at run time, and more.
View this webinar! |
Copyright © 1998-2008, ZATZ Publishing. All rights reserved worldwide.
|