Provided by: libgnuspool-dev_1.7ubuntu1_amd64 bug

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:

       GSPOOL_INVALID_FD
               Invalid File descriptor

       GSPOOL_BADWRITE
               failure writing to the network

       GSPOOL_BADREAD
               failure reading from the network

       GSPOOL_UNKNOWN_USER
               Invalid user name

       GSPOOL_NOPERM
               The user does not have permission

       GSPOOL_ZERO_CLASS
               class code of zero is illegal

       GSPOOL_BAD_PRIORITY
               One of the priority fields contains zero

       GSPOOL_BAD_COPIES
               The copies field contains zero

       GSPOOL_BAD_FORM
               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.