summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-05-10 01:01:30 +0000
committerTim Potter <tpot@samba.org>2001-05-10 01:01:30 +0000
commit469bddf537a22c4dd13b4c37ed3152d4765b6abd (patch)
treeb84c180ef66ed90c7aa62906a1f239fdb95e4d1e
parent281629ac063d431cc8a9b7975520ee7fa65a5568 (diff)
downloadsamba-469bddf537a22c4dd13b4c37ed3152d4765b6abd.tar.gz
samba-469bddf537a22c4dd13b4c37ed3152d4765b6abd.tar.bz2
samba-469bddf537a22c4dd13b4c37ed3152d4765b6abd.zip
Replaced a whole bunch of lookup_name() requests in
construct_default_printer_sdb() with checks of the owner rid instead. This should be much faster, work on non-English systems and systems with renamed user or group names. (This used to be commit 8b435b0a2ab1fa060473753fa05f0aba8406b607)
-rw-r--r--source3/printing/nt_printing.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 9b22ed5227..164ad58742 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -3039,16 +3039,19 @@ static SEC_DESC_BUF *construct_default_printer_sdb(TALLOC_CTX *ctx)
if (winbind_lookup_name(lp_workgroup(), &owner_sid, &name_type)) {
sid_append_rid(&owner_sid, DOMAIN_USER_RID_ADMIN);
} else {
+ uint32 owner_rid;
- /* Backup plan - make printer owned by admins or root. This should
- emulate a lanman printer as security settings can't be
- changed. */
+ /* Backup plan - make printer owned by admins or root.
+ This should emulate a lanman printer as security
+ settings can't be changed. */
- if (!lookup_name( "Printer Administrators", &owner_sid, &name_type) &&
- !lookup_name( "Administrators", &owner_sid, &name_type) &&
- !lookup_name( "Administrator", &owner_sid, &name_type) &&
- !lookup_name("root", &owner_sid, &name_type)) {
- sid_copy(&owner_sid, &global_sid_World);
+ sid_peek_rid(&owner_sid, &owner_rid);
+
+ if (owner_rid != BUILTIN_ALIAS_RID_PRINT_OPS &&
+ owner_rid != BUILTIN_ALIAS_RID_ADMINS &&
+ owner_rid != DOMAIN_USER_RID_ADMIN &&
+ !lookup_name("root", &owner_sid, &name_type)) {
+ sid_copy(&owner_sid, &global_sid_World);
}
}