use NDSm::NDSContext; use NDSm::Buf_T;
$Context = new NDSm::NDSContext; $Buf = new NDSm::Buf_T;
Then you should use the methods outlined below. Look in the t/ directory for examples.
This extension enables you to modify the data stored in Novell NDS. with perl 5.000 or higher. This module also includes methods for initalizing and misc methods, like WhoAmI and others. You should get the NWSDK with same version as this module from http://developer.novell.com to understand what each method do.
Creates a new NDSContext. Don't make to many context-objects. (8 for DOS, Windows NT has only 16, OS/2 Windows has 48). Maybe we should start using the new NWDSCreateContextHandle() which supports unlimited handles. Well, if anyone reach the limit in their script, please let me know.
Returns the handle to a context. A contaxt can have many properties set, but there are no support for changing these values yet. The value returned is just a number, so you can put it directly into an scalar and feed it to all methods that require the contexthandle.
This method is used internally to initialize things. You should normaly never use this directly. This method is called by new().
You can use IsInit() to find out if the NDSContext is created and initialized as it should be.
This method abbreviates the $Name. Converts a NDS name (including the naming attributes) to its shortest form relative to a specified name context. The abbreviated name is returned in $AbbreviatedName. The method return undef on failure.
Aborts a partition operation in progress. Returns 0 on success.
Adds a replica of an existing NDS partition to a server. $server is the name of the server where the replica is to be stored. $partitionRoot is the name of the root object of the NDS partition to be replicated. $replicaType specifies the type of the new replica (1:secondary or 2:read-only). Returns 0 on success.
Adds to the specified object's security equivalence. $equalTo Points to the name to be added to the Security Equivalence attribute of the object specified by equalFrom . This is handy when adding users to a group!. Returns 0 on success.
If you can authenticate to the NDS this returns != 0.
Converts an abbreviated name to the canonical form. The canonicalized name is returned in $Outname. For example, if the input is CN=Steinar Kleven and the name context is OU=Bar.O=Acme the canonicalized name is CN=Steinar kleven.OU=Bar.O=Acme
returns undef on failure.
This method set the password for a given object once a public/private key pair has been assigned. See GenerateObjectKeyPair... weee, not implemented yet... :-( The $Opt flag is not used... hmmm, maybe we can set the password without giving a old password using the right code. (NWAdmin can). Anyway, returns 0 on success.
Changes the replica type of a given replica on a given server. The available $NewType values are: 0 RT_MASTER Master replica 1 RT_SECONDARY Secondary replica 2 RT_READONLY Read-only replica Returns 0, on success.
This method is for internal use ONLY.
This method set the internal debugging of a class to a given level. uhmmm, Only 0 and and 1 are in use in version 0.13.03.
Returns the numeric value of a named constant, mostly for internal use.
Return the NDS Context-variable associated with $Key. Possible values for $Key includes (Copied from SDK-manuals): 1 DCK_FLAGS Bit definitions 2 DCK_CONFIDENCE Definitions: 0 DCV_LOW_CONF 1 DCV_MED_CONF 2 DCV_HIGH_CONF 3 DCK_NAME_CONTEXT Character string array 4 DCK_TRANSPORT_TYPE nuint32[2] Not currently in use 5 DCK_REFERRAL_SCOPE nuint32 Definitions: 0 DCV_ANY_SCOPE1 DCV_COUNTRY_SCOPE2DCV_ORGANIZATION_SCOPE3 DCV_LOCAL_SCOPE 8 DCK_LAST_CONNECTION Returns NWCONN_HANDLE 11 DCK_TREE_NAME Character string array of at most NW_MAX_TREE_NAME_LEN (includes NULL) ASCII or UNICODE characters This method returns undef on failure.
GetDefNameContext() returns the default name context for the logged in object.
Returns the partition root name of the given object ($ObjectName). The partition root name is returned in $partitionRoot. Returns undef on failure.
Return the last error-number from $Buf. The error-number is often an NDS error which is described if you press <F1> in NWadm* and search for 'Error'.
Moves an NDS object from one container to another and/or renames the object. $objectName is the name of the object to move. $destParentDN is the container where the object is to be put. $destRDN is the new name of the object. Example: CN=Steinar.OU=Devel.O=Makers and you want to move Steinar to Sales, for objectName pass in CN=Steinar.OU=Devel.O=Makers for destParentDN pass in OU=Sales.O=Makers and for destRDN pass in CN=Steinar Returns 0 on success
This method changes the state of the partition so all servers holding a partition replica will send entire partition information to the original partition. $partitionRoot holds the name root object name for the partition. $serverName holds the name of the server who has the partition witch should receive all updates. Returns 0 on success.
Like above, but tells the partition to SEND full updates Resturn 0 on success.
Tells the server named in $ServerName to reload the DS.NLM. Returns 0 on success.
Returns the object name as a typeless in $typeLess. Example: "CN=Steinar.OU=Devel.O=Makers" in $Name will return "Steinar.Devel.Makers" in $typeLess. Returns undef on failure.
Deletes an attribute definition ($AttrName) from the NDS Schema. Clients cannot subtract from the standard set of attribute definitions defined by the NDS Base Schema. (these attributes are flagged nonremovable). Clients can, however, add and remove non-standard definitions. (if not in use). Returns 0 on success.
Removes a class definition from the NDS Schema. The same rules as for RemoveAttrDef() apply when deleteing classdefinitions. Return 0 on success.
Removes the named object from NDS. The object can not have any subordinates. Returns 0 on success.
Removes the named partition from NDS by deleting its master replica.
*** THIS METHOD IF NOT A GOOD IDEA TO USE IF YOU'RE *** NOT ABSOLUTELY SURE WHAT YOU'RE DOING.
If this method return 0 you've toasted a partition. Did your NSD-aware backup system run last night ??
This method removes a replica from the replica set of an NDS partition. You can't remove the master replica with this method. If that's what you want you should use RemovePartition() instead. Read the man about RemovePartition() before using it !!!. Return 0 on success.
Removes a security equivalence from the specified object. $equalFrom is the name of the object whose Security Equivalence attribute is to be modified. $equalTo is the object name to be removed from the list. Also return 0 on success.
Sets the time stamps for all of a partition's objects and object attributes to the current time on the NetWare server where the master replica is located. $partitionRoot is the name of the partition's root object. Return 0 on success.
Replaces the abbreviated attribute name with its unabbreviated name. Example: If $inName is "CN", the value of $longName will be "Common Name". Returns undef on failure.
Sets the default name context to $NameContext; Return 0 on success.
This method returns the values in a list. The values are according to the current locale setting. Returns code_page, country_id as numbers.
This method sets the current CountryId and Codepage as defined by IBM. If called with () it uses the current setting for your machine. Return 0 on success.
Returns nonzero value if you are authenticated to NDS.
Performs all authentication operations needed to establish a client's connection to the network and to the network's authentication service. As of NWSDK(13) validperiod and options are not used. (Use 0) Returns 0 on success.
Guess!
Verifies the password of an object. $Passwd can be any length and all characters are significant. Upper- and lowercase letters are distinct. Can we use this to hack passwd's ?? Weee, I don't know if this get caught by the intruder lockout mechanism. If it passes through, Novell should plug the hole anyway, so I leave this method for anyone to know. Returns 0 on success.
This method is Novells answer to unix 'whoami'. Your loginname will be returned in $MyName. Return undef on failure.
http://www.ahs.hist.no/distr/NDSm/
Copyright (c) Steinar Kleven 1997. All rights reserved.
Steinar Kleven, mailto:Steinar.Kleven@ahs.hist.no