summaryrefslogtreecommitdiff
path: root/source3/printing/nt_printing.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-04-20 16:53:02 +0200
committerAndrew Bartlett <abartlet@samba.org>2009-04-20 16:53:02 +0200
commit6c9caed48187a0d18becf59ab636af44cbe521b0 (patch)
treec47170169077be6f8ae60aed739803ab4ba861b7 /source3/printing/nt_printing.c
parent53765c81f726a8c056cc4e57004592dd489975c9 (diff)
parent31120c9eacafd93e0f2c6b0f906af21adadd318a (diff)
downloadsamba-6c9caed48187a0d18becf59ab636af44cbe521b0.tar.gz
samba-6c9caed48187a0d18becf59ab636af44cbe521b0.tar.bz2
samba-6c9caed48187a0d18becf59ab636af44cbe521b0.zip
Merge commit 'origin/master' into libcli-auth-merge-without-netlogond
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r--source3/printing/nt_printing.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index f3b938e6ff..d6fead11c2 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -745,7 +745,7 @@ int get_builtin_ntforms(nt_forms_struct **list)
if (!*list) {
return 0;
}
- return sizeof(default_forms) / sizeof(default_forms[0]);
+ return ARRAY_SIZE(default_forms);
}
/****************************************************************************
@@ -754,18 +754,17 @@ int get_builtin_ntforms(nt_forms_struct **list)
bool get_a_builtin_ntform_by_string(const char *form_name, nt_forms_struct *form)
{
- int i,count;
+ int i;
DEBUGADD(6,("Looking for builtin form %s \n", form_name));
- count = sizeof(default_forms) / sizeof(default_forms[0]);
- for (i=0;i<count;i++) {
+ for (i=0; i<ARRAY_SIZE(default_forms); i++) {
if (strequal(form_name,default_forms[i].name)) {
DEBUGADD(6,("Found builtin form %s \n", form_name));
memcpy(form,&default_forms[i],sizeof(*form));
- break;
+ return true;
}
}
- return (i !=count);
+ return false;
}
/****************************************************************************
@@ -5736,7 +5735,7 @@ bool print_access_check(struct auth_serversupplied_info *server_info, int snum,
/* Always allow root or SE_PRINT_OPERATROR to do anything */
- if (server_info->utok.uid == 0
+ if (server_info->utok.uid == sec_initial_uid()
|| user_has_privileges(server_info->ptok, &se_printop ) ) {
return True;
}