gspool_putspu(3)

NAME
gspool_putspu - set default permissions for a user

SYNOPSIS
#include <gspool.h>

int gspool_putspu(const int fd, const char *user, struct apispdet *newp)

DESCRIPTION
The gspool_putspu() function is used to set privileges for a user.

fd is a file descriptor previously returned by gspool_open

user is a pointer to the user name, for which the details are being updated.

newp is a pointer to a structure containing the new user privileges.

The "struct apispdet" is defined int the file gspool.h.

RETURN VALUES
The function gspool_putspu() returns 0 if successful otherwise one of the following: Invalid File descriptor failure writing to the network failure reading from the network Invalid user name The user does not have permission class code of zero is illegal One of the priority fields contains zero The copies field contains zero The form type filed has been left empty

EXAMPLE
An example to give a user permission to add and delete printers

 int fd, ret;
 struct apispdet new_privs;

 fd = gspool_open("myhost", (char *)0, 0);
 if (fd < 0) { /* error handling */
     ...
 }

 ret = gspool_getspu(fd, "helen", &new_privs);
 if (ret < 0)   { /* error handling */
     ...
 }

 if (!(new_privs.spu_flgs & PV_ADDDEL))
     new_privs.spu_flgs |= PV_ADDDEL;

 gspool_close(fd);

SEE ALSO
gspool_getspu(3), gspool_getspd(3), gspool_putspd(3)

COPYRIGHT
Copyright (c) 2009 Free Software Foundation, Inc. This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.

AUTHOR
John M Collins, Xi Software Ltd.