gspool_putspu - set default permissions for a user
int gspool_putspu(const int fd, const char *user, struct apispdet *newp)
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.
The fields of the structure are as defined for gspool_getspu.
The function gspool_putspu() returns 0 if successful otherwise one of the following:
The function returns 0 if successful otherwise one of the error codes listed in Chapter 3.
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);
gspool_getspu(3),
gspool_getspd(3),
gspool_putspd(3)
John M Collins, Xi Software Ltd.