home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d09xx
/
d0905.lha
/
MultiUser
/
Auto
/
multiuser.doc
Wrap
Text File
|
1993-08-26
|
17KB
|
531 lines
TABLE OF CONTENTS
multiuser.library/muAllocUserInfo
multiuser.library/muCheckPasswd
multiuser.library/muFreeUserInfo
multiuser.library/muGetConfigDirLock
multiuser.library/muGetDefProtection
multiuser.library/muGetPasswdDirLock
multiuser.library/muGetTaskOwner
multiuser.library/muGetUserInfo
multiuser.library/muLimitDOSSetProtection
multiuser.library/muLoginA
multiuser.library/muLogoutA
multiuser.library/muPasswd
multiuser.library/muSetDefProtectionA
multiuser.library/muSetProtection
multiuser.library/muAllocUserInfo multiuser.library/muAllocUserInfo
NAME muAllocUserInfo() (V39)
info = muAllocUserInfo();
struct muUserInfo *muAllocUserInfo(void);
D0
DESCRIPTION
Allocates a muUserInfo structure for you in a future compatible manner.
This is the only valid way to allocate a muUserInfo structure. The
structure will be made empty for you.
INPUTS
none
RESULT
info - pointer to the allocated muUserInfo structure or NULL for no
memory.
BUGS
none known
SEE ALSO
muFreeUserInfo(), muGetUserInfo()
multiuser.library/muCheckPasswd multiuser.library/muCheckPasswd
NAME muCheckPasswd() (V39)
valid = muCheckPasswd(taglist);
BOOL muCheckPasswd(struct TagItem *);
D0 A0
DESCRIPTION
Check whether the supplied password is the valid password for the owner
of the current task.
This function is mainly intended to support SysLock look-alike programs
(cfr. XLock for the MIT's X Window System).
TAGS
muT_Password - (STRPTR)
the password.
INPUTS
taglist - a pointer to a taglist (may be NULL). No tags are currently
defined.
RESULT
valid - indicates the password is valid.
NOTE
This function may be extended in future to let the super user (root)
check passwords for other tasks.
BUGS
none known
SEE ALSO
muPasswd()
multiuser.library/muFreeUserInfo multiuser.library/muFreeUserInfo
NAME muFreeUserInfo() (V39)
muFreeUserInfo(info);
void muFreeUserInfo(struct muUserInfo *);
A0
DESCRIPTION
Frees a muUserInfo structure allocated with muAllocUserInfo.
INPUTS
info - a pointer to the muUserInfo structure you want to free. May be
NULL.
RESULT
none
BUGS
none known
SEE ALSO
muAllocUserInfo(), muGetUserInfo()
multiuser.library/muGetConfigDirLock multiuser.library/muGetConfigDirLock
NAME muGetConfigDirLock() (V39)
lock = muGetConfigDirLock();
BPTR muGetConfigDirLock(void);
D0
DESCRIPTION
Get a shared lock on the directory of the configuration file. The name
of the configuration file is defined in <libraries/multiuser.h>. If
this call succeeds, you must free the returned lock by yourself. This
function may be called only by the super user (root).
INPUTS
none
RESULT
lock - the desired lock, or NULL for failure.
BUGS
none known
SEE ALSO
muGetPasswdDirLock(), <libraries/multiuser.h>
multiuser.library/muGetDefProtection multiuser.library/muGetDefProtection
NAME muGetDefProtection() (V39)
mask = muGetDefProtection(task);
ULONG muGetDefProtection(struct Task *);
D0 D0
DESCRIPTION
Get the default protection bits related to a task.
INPUTS
task - a pointer to the task for which you want to know the default
protection bits, or NULL for the current task.
RESULT
mask - the default protection bits. They are in the format like defined
in <dos/dos.h>.
BUGS
none known
SEE ALSO
muSetDefProtectionA(), <dos/dos.h>
multiuser.library/muGetPasswdDirLock multiuser.library/muGetPasswdDirLock
NAME muGetPasswdDirLock() (V39)
lock = muGetPasswdDirLock();
BPTR muGetPasswdDirLock(void);
D0
DESCRIPTION
Get a shared lock on the directory of the password file. The name of
the password file is defined in <libraries/multiuser.h>. If this call
succeeds, you must free the returned lock by yourself. This function
may be called only by the super user (root).
INPUTS
none
RESULT
lock - the desired lock, or NULL for failure.
BUGS
none known
SEE ALSO
muGetConfigDirLock(), <libraries/multiuser.h>
multiuser.library/muGetTaskOwner multiuser.library/muGetTaskOwner
NAME muGetTaskOwner() (V39)
user = muGetTaskOwner(task);
ULONG muGetTaskOwner(struct Task *);
D0 D0
DESCRIPTION
Get the owner of a task.
INPUTS
task - a pointer to the task of which you want to know the owner, or NULL
for the current task.
RESULT
user - the owner of the specified task. The bits 31-16 specify the owner
user id (uid), the bits 15-0 specify the owner group id (gid).
NULL for nobody.
BUGS
none known
SEE ALSO
muGetUserInfo()
multiuser.library/muGetUserInfo multiuser.library/muGetUserInfo
NAME muGetUserInfo() (V39)
info = muGetUserInfo(info, keytype);
struct muUserInfo *muGetUserInfo(struct muUserInfo *, ULONG);
D0 A0 D0
DESCRIPTION
Get information about a user. You must pass in a muUserInfo structure
and a keytype, which defines the type of information you have filled in
in the muUserInfo structure about the wanted user(s). Valid keytypes
are:
muKeyType_First - find the first user. You don't have to fill
in any fields in the muUserInfo structure.
muKeyType_Next - find the next user. Use this only after
you've made a call with muKeyType_First as
keytype.
muKeyType_UserID - find a user with a specific UserID. Fill in
the field UserID before calling
muGetUserInfo(). The search will be case
sensitive.
muKeyType_WUserID - find a user with a specific UserID. Fill in
the field UserID before calling
muGetUserInfo(). The search will be case
insensitive, wild cards are allowed.
muKeyType_WUserIDNext - find the next user with a specific UserID.
Use this only after you've made a call with
muKeyType_WUserID as keytype.
muKeyType_uid - find a user with a specific uid. Fill in the
field uid before calling muGetUserInfo().
muKeyType_gid - find a user with a specific gid. Fill in the
field uid before calling muGetUserInfo().
muKeyType_gidNext - find the next user with a specific gid. Use
this only after you've made a call with
muKeyType_gid as keytype.
muKeyType_UserName - find a user with a specific UserName. Fill
in the field UserName before calling
muGetUserInfo(). The search will be case
insensitive.
muKeyType_WUserName - find a user with a specific UserName. Fill
in the field UserName before calling
muGetUserInfo(). The search will be case
insensitive, wild cards are allowed.
muKeyType_WUserNameNext - find the next user with a specific UserName.
Use this only after you've made a call with
muKeyType_WUserName as keytype.
INPUTS
info - a muUserInfo structure, allocated with muAllocUserInfo.
keytype - the magic keytype.
RESULT
info - a pointer to the supplied muUserInfo structure, or NULL for a
failure.
NOTE
Do not change the contents of a muUserInfo structure before calls to
muGetUserInfo() with muKeyType_Next, muKeyType_WUserIDNext,
muKeyType_gidNext or muKeyType_WUserNameNext.
BUGS
none known
SEE ALSO
muAllocUserInfo(), muGetUserInfo(), <libraries/multiuser.h>,
dos.library/SetOwner()
multiuser.library/muLimitDOSSetProtectionmultiuser.library/muLimitDOSSetProtection
NAME muLimitDOSSetProtection() (V39)
success = muLimitDOSSetProtection(flag);
BOOL muLimitDOSSetProtection(BOOL);
D0 D0
DESCRIPTION
Limit dos.library/SetProtection() to change only the protection bits for
the owner of the file. If limiting is turned on, you can change the
protection bits for GROUP and OTHER only via muSetProtection(). Default
limiting is turned off.
INPUTS
flag - TRUE to turn limiting on, FALSE to turn limiting off.
RESULT
success - success indicator.
NOTE
This function is useful because a lot of programs change the protection
bits of a file without knowing about the new GROUP and OTHER flags.
BUGS
Limiting will fail if someone has an exclusive lock on the file or
directory the protection bits will be changed of.
SEE ALSO
muSetProtection()
multiuser.library/muLoginA multiuser.library/muLoginA
NAME muLoginA() (V39)
user = muLoginA(taglist);
ULONG muLoginA(struct TagItem *);
D0 A0
DESCRIPTION
Login to the system and remember the last user. Use the taglist to
specify options.
TAGS
muT_Graphical - (BOOL)
use a graphical login instead of a console alike one.
Default is FALSE.
muT_Input - (BPTR)
specify the filehandle to read from. Not used for a
graphical login. Default is Input().
muT_Output - (BPTR)
specify the filehandle to write to. Not used for a
graphical login. Default is Output().
muT_PubScrName - (STRPTR)
specify the public screen to open the login requester
on. Only used for a graphical login. Default is the
default public screen (mostly the Workbench screen).
muT_Task - (struct Task *)
specify the task you want to login. Of course this
works only for your own tasks (or for tasks owned by
nobody), unless you are the super user (root). Default
is the current task.
muT_Own - (BOOL)
change the owner of the specified task to the owner of
the task this call is made from. Of course this works
only for tasks owned by nobody, unless you are the super
user (root). Default is FALSE.
muT_Global - (BOOL)
login for all tasks on the same level as the specified
one. Default is FALSE.
muT_UserID - (STRPTR)
do not ask the user for a UserID but use the specified
UserID. Must be used together with muT_Password.
muT_Password - (STRPTR)
do not ask the user for a Password but use the specified
Password. Must be used together with muT_UserID.
INPUTS
taglist - a pointer to a taglist (may be NULL).
RESULT
user - the user that logged in, or NULL for a failure. The bits 31-16
specify the owner user id (uid), the bits 15-0 specify the owner
group id (gid).
NOTE
The tags muT_UserID and muT_Password are mainly intended to let programs
change their owner to someone else temporarily. If you want to restore
the previous user later you must be aware of the fact that a call to
muLogoutA() may invoke a login request!
BUGS
none known
SEE ALSO
muLogoutA()
multiuser.library/muLogoutA multiuser.library/muLogoutA
NAME muLogoutA() (V39)
user = muLogoutA(taglist);
ULONG muLogoutA(struct TagItem *);
D0 A0
DESCRIPTION
Logout and restore the previous user. If there was no previous user or
the previous user was nobody, a login request will appear. However, the
behavior of this login request will be slightly different from that of
muLoginA(), more specifically the following actions will be taken:
- the local variable 'Home' will be set to your home directory.
- the current directory will be set to your home directory.
- If there exists a script file called '.profile' in your home
directory, it will be executed.
TAGS
muT_Input - see muLoginA()
muT_Output - see muLoginA()
muT_Graphical - see muLoginA()
muT_PubScrName - see muLoginA()
muT_Task - see muLoginA()
muT_Own - see muLoginA()
muT_Global - see muLoginA()
muT_Quiet - (BOOL)
Never request for a login, simply logout. Default FALSE.
INPUTS
taglist - a pointer to a taglist (may be NULL).
RESULT
user - the user you're now, NULL for nobody. The bits 31-16 specify the
owner user id (uid), the bits 15-0 specify the owner group id
(gid).
NOTE
If there was no previous user, this routine will not return until you
enter a valid UserID/password pair (unless you used the tag muT_Quiet)!
However, this tag may be removed in future releases for enhanced
security.
BUGS
none known
SEE ALSO
muLoginA()
multiuser.library/muPasswd multiuser.library/muPasswd
NAME muPasswd() (V39)
success = muPasswd(oldpwd, newpwd);
BOOL muPasswd(STRPTR, STRPTR);
D0 A0 A1
DESCRIPTION
Change the password for the owner of the task this routine is called
from.
INPUTS
oldpwd - your old password.
newpwd - your new password.
RESULT
success - indicates a successful password change.
NOTE
For the format of the passwd-file, see <libraries/multiuser.h>. This
format should be compatible with the Commodore AS255 passwd file.
BUGS
none known
SEE ALSO
muCheckPasswd(), <libraries/multiuser.h>
multiuser.library/muSetDefProtectionA multiuser.library/muSetDefProtectionA
NAME muSetDefProtectionA() (V39)
success = muSetDefProtectionA(taglist);
BOOL muSetDefProtectionA(struct TagItem);
D0 A0
DESCRIPTION
Set the default protection bits related to a task. Of course this works
only for your own tasks (or for tasks owned by nobody), unless you are
the super user (root).
TAGS
muT_Task - (struct Task *)
specify the task you want to change the default
protection bits for. Default is the current task.
muT_DefProtection - (ULONG)
the default protection bits. They must be in the
format like defined in <dos/dos.h> (or take a look at
<libraries/multiuser.h> if you don't have 3.0
includes:-). Default is FIBF_OTR_READ|FIBF_GRP_READ.
muT_Global - (BOOL)
change the default protection bits for all tasks on
the same level as the specified one. Default is
FALSE.
INPUTS
taglist - a pointer to a taglist (may be NULL).
RESULT
success - success indicator.
BUGS
none known
SEE ALSO
muGetDefProtection(), <dos/dos.h>
multiuser.library/muSetProtection multiuser.library/muSetProtection
NAME muSetProtection() (V39)
success = muSetProtection(name, mask);
BOOL muSetProtection(STRPTR, LONG);
D0 D1 D2
DESCRIPTION
Set the protection attributes on a file or directory. See <dos/dos.h>
for a listing of protection bits and dos.library SetProtection() for more
information.
Using this function you can set the protection bits for GROUP and OTHER
too.
INPUTS
name - pointer to a null-terminated string
mask - the protection mask required
RESULT
success - success indicator.
BUGS
none known
SEE ALSO
muLimitDOSSetProtection(), dos.library/SetProtection(), <dos/dos.h>