1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

634 Commits

Author SHA1 Message Date
Volker Lendecke
a3c0be6325 Change print_access_check to take auth_serversupplied_info instead of current_user
Reason: This is the main user of p->current_user which I would like to remove
(This used to be commit fd43059b3d)
2008-06-26 13:13:23 +02:00
Volker Lendecke
320fadd8fc Remove the reference to current_user_info from share_access.c
This required to pass around the domain a bit
(This used to be commit 17b0db20d2)
2008-05-25 11:43:57 +02:00
Tim Prouty
fb37f15600 Cleanup size_t return values in callers of convert_string_allocate
This patch is the second iteration of an inside-out conversion to cleanup
functions in charcnv.c returning size_t == -1 to indicate failure.
(This used to be commit 6b189dabc5)
2008-05-20 22:40:13 +02:00
Jeremy Allison
fbc780b604 Try and fix bug #5095, "Manage Documents privilege is not functional".
Should map the created sd to printer jobs, not printer.
Jerry please test and I'll add to 3.2 if it passes. Thanks,
Jeremy.
(This used to be commit 0a1fe8d601)
2008-05-05 16:24:52 -07:00
Jeremy Allison
501562f15c Fix from Martin Zielinski <mz@seh.de>. Don't delete files when
they're in use by other drivers.
Jeremy.
(This used to be commit 205c352cae)
2008-04-24 15:02:23 -07:00
Jeremy Allison
40d16fa275 Fix bug #5372. With a large CUPS installation with a remote server, contacting
the server when searching for a name for the location and comment fields can
take so much time the client times out. When searching for a name we don't
use these fields anyway, so add a function get_a_printer_search() which
doesn't contact the CUPS server.
Jeremy.
(This used to be commit 92d9f20852)
2008-04-04 11:14:09 -07:00
Volker Lendecke
c5356479c1 Some simplifications
(This used to be commit b59b436997)
2008-03-17 21:10:16 +01:00
Marc VanHeyningen
e06aa46b9f Coverity fixes
(This used to be commit 3fc85d2259)
2008-03-17 20:52:25 +01:00
Volker Lendecke
594a164548 Fix a crash bug in nt_printer_publish_ads
Reported by Martin Zielinski <mz@seh.de>
(This used to be commit 4db26c803d)
2008-01-16 11:39:20 +01:00
Jeremy Allison
23aab9dab7 Fix CID 498. Ensure we don't prs_mem_free an uninitialized
prs_struct.
Jeremy.
(This used to be commit 7b9d9fba23)
2008-01-11 23:24:13 -08:00
Michael Adam
87a684f7fc Remove redundant parameter fd from SMB_VFS_FSTAT().
Michael
(This used to be commit 0b86c420be)
2008-01-07 15:59:01 +01:00
Michael Adam
6f657c873e Remove redundant parameter fd from SMB_VFS_LSEEK().
Michael
(This used to be commit df929796f2)
2008-01-07 15:59:01 +01:00
Jeremy Allison
9254bb4ef1 Refactor the crypto code after a very helpful conversation
with Volker. Mostly making sure we have data on the incoming
packet type, not stored in the smb header.
Jeremy.
(This used to be commit c4e5a50504)
2008-01-04 12:56:23 -08:00
Volker Lendecke
7cbdb48475 Remove tiny code duplication
ndr_size_security_descriptor does the same as sec_desc_size
(This used to be commit bc3bd7a8e7)
2007-12-29 23:13:26 +01:00
Jeremy Allison
7326612cfd Two more static fstrings gone.
Jeremy.
(This used to be commit 4056bb8645)
2007-12-18 18:16:40 -08:00
Volker Lendecke
900288a2b8 Replace sid_string_static by sid_string_dbg in DEBUGs
(This used to be commit bb35e794ec)
2007-12-15 22:09:36 +01:00
Jeremy Allison
b9342eaaa6 Remove unused wpstring and macros. Stop using pstrcpy in smbd/*.c
Jeremy.
(This used to be commit e72bce5b62)
2007-12-03 15:19:22 -08:00
Jeremy Allison
bcf033b38e Change tdb_unpack "P" to return a malloc'ed string rather
than expect a pstring space to put data into.
Fix the (few) callers.
Jeremy.
(This used to be commit 7722a7d2c6)
2007-12-03 14:54:06 -08:00
Volker Lendecke
1011b32678 Remove some statics
(This used to be commit 1fab16ffb8)
2007-11-27 14:18:47 +01:00
Jeremy Allison
01acd4bb38 Remove pstring from printing/*.c except for the
tdb_unpack requirement (I'll be making that an
allocating interface later).
Jeremy.
(This used to be commit d2ee75326a)
2007-11-21 13:56:36 -08:00
Jeremy Allison
68be9a8200 More pstring removal. This one was tricky. I had to add
one horror (pstring_clean_name()) which will have to
remain until I've removed all pstrings from the client code.
Jeremy.
(This used to be commit 1ea3ac8014)
2007-11-15 14:19:52 -08:00
Jeremy Allison
214bb0f119 Fix case where we have no dns domain name. Return a talloc of "".
Jeremy.
(This used to be commit ab8934844a)
2007-11-08 17:58:55 -08:00
Jeremy Allison
d40e47db4b Remove more fstring/pstring bad useage. Go talloc !
Jeremy.
(This used to be commit 2a0173743d)
2007-11-08 17:25:45 -08:00
Gerald (Jerry) Carter
88ee61625a Patch 2 of 3 from Debian Samba packagers:
The point is doing the following associations:

- non discardable state data (all TDB files that may need to be backed
  up) go to statedir
- shared data (codepage stuff) go to codepagedir

The patch *does not change* the default location for these
directories. So, there is no behaviour change when applying it.

The main change is for samba developers who have to think when dealing
with files that previously pertained to libdir whether they:
- go in statedir
- go in codepagedir
- stay in libdir
(This used to be commit d6cdbfd875)
2007-11-01 15:53:44 -04:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Volker Lendecke
0ebab65706 r25534: Apply some const
Why? It moves these structs from the data into the text segment, so they
will never been copy-on-write copied. Not much, but as in German you say
"Kleinvieh macht auch Mist...."
(This used to be commit 0141e64ad4)
2007-10-10 12:31:12 -05:00
Michael Adam
c97fe37ea3 r25294: Tidy up callers of unistr2_to_ascii() to pass sizeof(target_area) to
the maxeln parameter instead of sizeof(target_area) - 1 (or even
sizeof(fstring) - 1 in some places.

I hope these were really all there were.

Michael
(This used to be commit 9a28be220d)
2007-10-10 12:30:58 -05:00
Jeremy Allison
eacd314057 r25138: More pstring elimination. Add a TALLOC_CTX parameter
to unix_convert().
Jeremy.
(This used to be commit 39c211a702)
2007-10-10 12:30:44 -05:00
Jeremy Allison
12f61e09d9 r25117: The mega-patch Jerry was waiting for. Remove all pstrings from
the main server code paths. We should now be able to cope with
paths up to PATH_MAX length now.
Final job will be to add the TALLOC_CTX * parameter to
unix_convert to make it explicit (for Volker).
Jeremy.
(This used to be commit 7f0db75fb0)
2007-10-10 12:30:41 -05:00
Jeremy Allison
132ee3990a r25009: Large patch discussed with Volker. Move unix_convert to a talloc-based
interface. More development will come on top of this. Remove the
"mangled map" parameter.
Jeremy.
(This used to be commit dee8beba7a)
2007-10-10 12:30:32 -05:00
Stefan Metzmacher
809c9d4d31 r23888: move elements belonging to the current ldap connection to a
substructure.

metze
(This used to be commit 00909194a6)
2007-10-10 12:28:38 -05:00
Andrew Tridgell
153cfb9c83 r23801: The FSF has moved around a lot. This fixes their Mass Ave address.
(This used to be commit 87c91e4362)
2007-10-10 12:28:27 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Volker Lendecke
0bc56a2e5f r23724: Reduce access to the global inbuf a tiny bit. Add a struct smb_request
that contains some of the fields from the SMB header, removing the need
to access inbuf directly. This right now is used only in the open file
code & friends, and creating that header is only done when needed. This
needs more work, but it is a start.

Jeremy, I'm only checking this into 3_0, please review before I merge it
to _26.

Volker
(This used to be commit ca988f4e79)
2007-10-10 12:23:48 -05:00
Volker Lendecke
e95942ed84 r22954: More messaging_register
(This used to be commit 9b8df24107)
2007-10-10 12:22:11 -05:00
Volker Lendecke
b4a7b7a888 r22844: Introduce const DATA_BLOB data_blob_null = { NULL, 0, NULL }; and
replace all data_blob(NULL, 0) calls.
(This used to be commit 3d3d61687e)
2007-10-10 12:22:01 -05:00
Günther Deschner
3e8283cf7c r22524: Fix memleak.
Guenther
(This used to be commit e55c52f654)
2007-10-10 12:19:42 -05:00
Stefan Metzmacher
bc2b6436d0 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
(This used to be commit 3a28443079)
2007-10-10 12:19:00 -05:00
Stefan Metzmacher
110980d771 r21989: make use of tdb_*_bystring() and string_term_tdb_data()
to avoid creating the TDB_DATA struct from strings "by hand"

metze
(This used to be commit 1897da9efc)
2007-10-10 12:18:57 -05:00
Stefan Metzmacher
a806037b87 r21987: split tdb_prs_*() functions in version which take a keystr and a TDB_DATA key
metze
(This used to be commit 724c6fa337)
2007-10-10 12:18:56 -05:00
Gerald Carter
1899c834f0 r21875: BUG 3275: Patch from Andy Polyakov <appro@fy.chalmers.se>
Relax check for i386 header checks in the PE header of printer
driver files.  Thus allowing uploading of x64 print drivers
from 64bit Windows clients.
(This used to be commit 328807ec7b)
2007-10-10 12:18:42 -05:00
Gerald Carter
2d30923864 r21862: add the cups comment and location lookup to get_a_printer_2_default() as well
(This used to be commit 5b47c4e5c2)
2007-10-10 12:18:39 -05:00
Gerald Carter
b2bc94eeee r21861: Pull the comment and location from CUPS if we don't have one
when fetching a printer from ntprinters.tdb.

Slightly modified from original version submitted on
samba-technical ml by Andy Polyakov <appro@fy.chalmers.se>
(This used to be commit e859e1fdcd)
2007-10-10 12:18:39 -05:00
Jeremy Allison
10ab7a3a78 r21672: The cannonical file access pattern should look like this :
srvstr_get_path(inbuf, name, smb_buf(inbuf) + 1, sizeof(name), 0, STR_TERMINATE, &status);
	if (!NT_STATUS_IS_OK(status)) {
		return ERROR_NT(status);
	}

	RESOLVE_DFSPATH(name, conn, inbuf, outbuf);

	status = unix_convert(conn, name, False, NULL, &sbuf);
	if (!NT_STATUS_IS_OK(status)) {
		return ERROR_NT(status);
	}

	status = check_name(conn, name);
	if (!NT_STATUS_IS_OK(status)) {
		return ERROR_NT(status);
	}

Make sure that every access pattern (including the
wildcard generated paths from unlink, rename, and copy)
do the same. Tidy things up a bit....

Jeremy.
(This used to be commit b8327b21dd)
2007-10-10 12:18:23 -05:00
Simo Sorce
e9e6af5951 r21606: Implement escaping function for ldap RDN values
Fix escaping of DN components and filters around the code
Add some notes to commandline help messages about how to pass DNs

revert jra's "concistency" commit to nsswitch/winbindd_ads.c, as it was
incorrect.
The 2 functions use DNs in different ways.

- lookup_usergroups_member() uses the DN in a search filter,
and must use the filter escaping function to escape it
Escaping filters that include escaped DNs ("\," becomes "\5c,") is the
correct way to do it (tested against W2k3).

- lookup_usergroups_memberof() instead uses the DN ultimately as a base dn.
Both functions do NOT need any DN escaping function as DNs can't be reliably
escaped when in a string form, intead each single RDN value must be escaped
separately.

DNs coming from other ldap calls (like ads_get_dn()), do not need escaping as
they come already escaped on the wire and passed as is by the ldap libraries

DN filtering has been tested.
For example now it is possible to do something like:
'net ads add user joe#5' as now the '#' character is correctly escaped when
building the DN, previously such a call failed with Invalid DN Syntax.

Simo.
(This used to be commit 5b4838f62a)
2007-10-10 12:18:16 -05:00
Gerald Carter
56b40269c8 r21258: Fix for connecting printers from Vista by storing
the printer GUID as a REG_SZ as Vista seems to
whine about unknown REG_BINARY values.

Thanks to Martin Zielinski <mz@seh.de> for his excellent
analysis on this.
(This used to be commit fa5490b71b)
2007-10-10 12:17:52 -05:00
Volker Lendecke
caf8c6a76b r21064: The core of this patch is
void message_register(int msg_type,
                      void (*fn)(int msg_type, struct process_id pid,
-                                void *buf, size_t len))
+                                void *buf, size_t len,
+                                void *private_data),
+                     void *private_data)
 {
        struct dispatch_fns *dfn;

So this adds a (so far unused) private pointer that is passed from
message_register to the message handler. A prerequisite to implement a tiny
samba4-API compatible wrapper around our messaging system. That itself is
necessary for the Samba4 notify system.

Yes, I know, I could import the whole Samba4 messaging system, but I want to
do it step by step and I think getting notify in is more important in this
step.

Volker
(This used to be commit c8ae60ed65)
2007-10-10 12:17:32 -05:00
Volker Lendecke
0cfc6a8e11 r20796: Fix the same problem Jeremy has fixed (improper handling of deferred opens)
for delete_driver_files. Proper fix pending... :-)

Jeremy, please check.

Volker
(This used to be commit 21b8f15dd5)
2007-10-10 12:17:09 -05:00
Jeremy Allison
db0ad252a0 r20718: Sync up the filename path parsing changes from SAMBA_3_0_24.
The only difference between the two trees now w.r.t file
serving are the changes to smbd/open.c in this branch I need
to review.
Jeremy.
(This used to be commit f4474edf6a)
2007-10-10 12:17:04 -05:00
Volker Lendecke
1307337aaf r20544: Change copy_file() to return NTSTATUS. This is in preparation of turning
close_file() to NTSTATUS as well.

I'm not sure I got all the error codes right, but as I've never come across a
smb_copy() call in all my Samba work, I'm leaving it at that. If I'm
absolutely bored, I will write a thorough torture test.

As far as I can see, Samba4 even does not have a libcli implementation for
it...  :-)

Volker
(This used to be commit 5ebdf02ba1)
2007-10-10 12:16:56 -05:00
Volker Lendecke
d0c6f9b728 r20339: Make mkdir_internal static to open.c
(This used to be commit 6dd0886b49)
2007-10-10 12:16:42 -05:00
Jelmer Vernooij
4db7642caa r18745: Use the Samba4 data structures for security descriptors and security descriptor
buffers.

Make security access masks simply a uint32 rather than a structure
with a uint32 in it.
(This used to be commit b41c52b9db)
2007-10-10 12:00:54 -05:00
Jelmer Vernooij
4e7d11449a r18654: Rename "struct uuid" => "struct GUID" for consistency.
(This used to be commit 5de76767e8)
2007-10-10 11:52:19 -05:00
Volker Lendecke
ee0e397d6f r18019: Fix a C++ warnings: Don't use void * in libads/ for LDAPMessage anymore.
Compiled it on systems with and without LDAP, I hope it does not break the
build farm too badly. If it does, I'll fix it tomorrow.

Volker
(This used to be commit b2ff9680eb)
2007-10-10 11:39:49 -05:00
Volker Lendecke
08e308fe2c r17590: Some C++ Warnings
(This used to be commit b7ec240880)
2007-10-10 11:38:41 -05:00
Jeremy Allison
fbdcf2663b r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
Gerald Carter
be25a49a94 r16701: Fix segv when adding a printer caused by not initializing the
realm name in ads_init() in nt_printer_publish().
(This used to be commit a25e75e78d)
2007-10-10 11:19:09 -05:00
Jeremy Allison
d1014c1cdf r16582: Fix Klocwork #1997 and all generic class of problems
where we don't correctly check the return from memdup.
Jeremy.
(This used to be commit ce14daf51c)
2007-10-10 11:19:01 -05:00
Jeremy Allison
f014291edd r16424: Fix possible null deref and a memory leak found by
examining Klockwork #1519. get_printer_subkeys()
could return zero without initializing it's return
pointer arg. Fixed this. Added free of subkey pointer
return in registry/reg_printing.c (interesting that
neithe Coverity or Klocwork found this one).
Jeremy.
(This used to be commit 4fbeae1a3a)
2007-10-10 11:18:52 -05:00
Jeremy Allison
1b64f06048 r16367: Missed one, Klocwork #915.
Jeremy.
(This used to be commit b581fee982)
2007-10-10 11:18:49 -05:00
Jeremy Allison
d5b6dedfdd r16365: Fix Klocwork #895, #898, #899, #915, #932, #938 and a
few other problems Klocwork missed.
Jeremy.
(This used to be commit fe05769a1a)
2007-10-10 11:18:49 -05:00
Volker Lendecke
5895967601 r15569: Fix Coverity bug # 287. Jerry, can you check if WERR_NOMEM is a correct error
code here?

Thanks,

Volker
(This used to be commit 5787bd0ee9)
2007-10-10 11:17:01 -05:00
Gerald Carter
2c029a8b96 r15543: New implementation of 'net ads join' to be more like Windows XP.
The motivating factor is to not require more privileges for
the user account than Windows does when joining a domain.

The points of interest are

* net_ads_join() uses same rpc mechanisms as net_rpc_join()
* Enable CLDAP queries for filling in the majority of the
  ADS_STRUCT->config information
* Remove ldap_initialized() from sam/idmap_ad.c and
  libads/ldap.c
* Remove some unnecessary fields from ADS_STRUCT
* Manually set the dNSHostName and servicePrincipalName attribute
  using the machine account after the join

Thanks to Guenther and Simo for the review.

Still to do:

* Fix the userAccountControl for DES only systems
* Set the userPrincipalName in order to support things like
  'kinit -k' (although we might be able to just use the sAMAccountName
  instead)
* Re-add support for pre-creating the machine account in
  a specific OU
(This used to be commit 4c4ea7b20f)
2007-10-10 11:16:57 -05:00
Gerald Carter
d4a51cc500 r15309: normalize printing keys when deleting
(This used to be commit 037f9f831e)
2007-10-10 11:16:34 -05:00
Volker Lendecke
e17302200c r15101: Little step towards getting Samba4 tdb into 3: tdb_lock_bystring does not
have the timeout argument in Samba4. Add a new routine
tdb_lock_bystring_with_timeout.

Volker
(This used to be commit b9c6e3f556)
2007-10-10 11:16:23 -05:00
Günther Deschner
a17d276fa0 r14506: Remove remaining references to a KCM credential cache type.
Guenther
(This used to be commit aae8f8ae7a)
2007-10-10 11:15:35 -05:00
Jeremy Allison
419871306c r14489: Guard against coverity reversion. #181 is a false positive
but make the intent clearer.
Jeremy.
(This used to be commit 2703df7a8f)
2007-10-10 11:15:34 -05:00
Jeremy Allison
3b58c82a52 r14273: Fix coverity bug #202. Memory leak on error path.
Jeremy.
(This used to be commit d2be8163f2)
2007-10-10 11:15:22 -05:00
Jeremy Allison
c00e664e25 r14221: Fix coverity #76. My previous change wasn't quite enough :-).
Jeremy.
(This used to be commit 21b70035f3)
2007-10-10 11:15:17 -05:00
Jeremy Allison
f2006f8ce1 r14184: Coverity fix #56. Ensure we can't deref null.
Jeremy.
(This used to be commit c76092a066)
2007-10-10 11:15:15 -05:00
Jeremy Allison
894358a8f3 r13915: Fixed a very interesting class of realloc() bugs found by Coverity.
realloc can return NULL in one of two cases - (1) the realloc failed,
(2) realloc succeeded but the new size requested was zero, in which
case this is identical to a free() call.

The error paths dealing with these two cases should be different,
but mostly weren't. Secondly the standard idiom for dealing with
realloc when you know the new size is non-zero is the following :

 tmp = realloc(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

However, there were *many* *many* places in Samba where we were
using the old (broken) idiom of :

 p = realloc(p, size)
 if (!p) {
    return error;
 }

which will leak the memory pointed to by p on realloc fail.

This commit (hopefully) fixes all these cases by moving to
a standard idiom of :

 p = SMB_REALLOC(p, size)
 if (!p) {
    return error;
 }

Where if the realloc returns null due to the realloc failing
or size == 0 we *guarentee* that the storage pointed to by p
has been freed. This allows me to remove a lot of code that
was dealing with the standard (more verbose) method that required
a tmp pointer. This is almost always what you want. When a
realloc fails you never usually want the old memory, you
want to free it and get into your error processing asap.

For the 11 remaining cases where we really do need to keep the
old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR,
which can be used as follows :

 tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the
pointer p, even on size == 0 or realloc fail. All this is
done by a hidden extra argument to Realloc(), BOOL free_old_on_error
which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR
macros (and their array counterparts).

It remains to be seen what this will do to our Coverity bug count :-).

Jeremy.
(This used to be commit 1d710d06a2)
2007-10-10 11:10:59 -05:00
Gerald Carter
b2ae6e08da r13547: add earlier checks to deny deleting a printer driver. The previous
code relied upon file permissions alone.  Now we check that
the user is a printer administrator and that the share has not been
marked read only for that user.
(This used to be commit 117d9fd9e1)
2007-10-10 11:10:12 -05:00
Gerald Carter
0af1500fc0 r13316: Let the carnage begin....
Sync with trunk as off r13315
(This used to be commit 17e63ac4ed)
2007-10-10 11:06:23 -05:00
Jeremy Allison
d14af63e6a r13293: Rather a big patch I'm afraid, but this should fix bug #3347
by saving the UNIX token used to set a delete on close flag,
and using it when doing the delete. libsmbsharemodes.so still
needs updating to cope with this change.
Samba4 torture tests to follow.
Jeremy.
(This used to be commit 23f16cbc2e)
2007-10-10 11:06:21 -05:00
Gerald Carter
dbac670166 r12889: BUG 3380: fix crash when changing printer drivers caused by accessing a previously freed pointer
(This used to be commit bcce3b69f8)
2007-10-10 11:06:06 -05:00
Jeremy Allison
6baec64a73 r11420: Fix issue pointed out by Dina Fine <dina@exanet.com>. We can
only tell at parse time from the wire if an incoming name
has wildcards or not. If it's a mangled name and we demangle
the demangled name may contain wildcard characters. Ensure
these are ignored.
Jeremy.
(This used to be commit 4cd8e2a96b)
2007-10-10 11:05:15 -05:00
Gerald Carter
a1faaa9e67 r10554: * BUG 3057: assume x64 drivers are v3 drivers
* BUG 3087: allow smbspool to establisha geust connection
  using a username with no password
(This used to be commit 39369c8041)
2007-10-10 11:04:47 -05:00
Günther Deschner
b4857a4c2a r10154: Fix crash bug on security descriptor upgrade (as seen on x86_64).
Guenther
(This used to be commit daa61ef75b)
2007-10-10 11:03:35 -05:00
Gerald Carter
44707ad2e0 r9739: conver the reg_objects (REGSUBKEY_CTR & REGVAL_CTR) to use
the new talloc() features:

 Note that the REGSUB_CTR and REGVAL_CTR objects *must* be talloc()'d
 since the methods use the object pointer as the talloc context for
 internal private data.

 There is no longer a regXXX_ctr_intit() and regXXX_ctr_destroy()
 pair of functions.  Simply TALLOC_ZERO_P() and TALLOC_FREE() the
 object.

Also had to convert the printer_info_2->NT_PRINTER_DATA field
to be talloc()'d as well.  This is just a stop on the road to
cleaning up the printer memory management.
(This used to be commit ef721333ab)
2007-10-10 11:03:25 -05:00
Gerald Carter
ac42cd59f2 r9086: * fix invalid read in parse_spoolss when writing a devmode to
the wire
* fix dup_a_regval() when size is 0
* ensure we pass a pstring to unlink_internals (fixes delete_driver
  code)
(This used to be commit 353e63ff42)
2007-10-10 11:00:25 -05:00
Gerald Carter
ef0e98b757 r8543: merge volker's nt_printing_init() fix from trunk (r8526)
but make sure to write the new version to the ntdrivers.tdb.
(This used to be commit 9e50d696c3)
2007-10-10 11:00:08 -05:00
Gerald Carter
6fe5451543 r8501: * disable printer handle object cache (was mostly used
for NT4 clients enumerating printer data on slow CPUs)
* fix pinter and secdesc record upgrade to normalize the key
  (rev'd printer tdb version)
* fixed problem that was normalizing the printername name field

in general, this should fix the issues upgrading print servers
from 3.0.14a to 3.0.20
(This used to be commit d07179de2f)
2007-10-10 11:00:06 -05:00
Jeremy Allison
af8a691db1 r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the torture
tests on this as it's very late NY time (just wanted to get this work
into the tree). I'll test this over the weekend....
Jerry - in looking at the difference between the two trees there
seem to be some printing/ntprinting.c and registry changes we might
want to examine to try keep in sync.
Jeremy.
(This used to be commit c7fe18761e)
2007-10-10 10:58:18 -05:00
Gerald Carter
22ea1952c8 r8089: successfully delete printer subkeys via the registry....now for values
(This used to be commit d3427960b0)
2007-10-10 10:58:10 -05:00
Gerald Carter
c296f858ef r8066: * had to modify the printer data storage slightly in ntprinters.tdb
when packing values.  It is a compatible change though and will
  not require a tdb version upgrade
* Can successfully create new printer subkeys via winreg that
  are immediately available via spoolss calls.  Still cannot delete
  keys yet though.  That comes next.
(This used to be commit 00bce2b3bb)
2007-10-10 10:58:10 -05:00
Gerald Carter
9ef00c5b1b r8025: *how* can this code have been around so long and
nver normalized the string used for printer and
sec_desc key lookups ?????

normalized sharename to lower case before storing/fetching
from tdb.

Need to look at drivers and forms tdb as well (perhaps).
(This used to be commit 4aec5dce5c)
2007-10-10 10:58:09 -05:00
Gerald Carter
e2b9dfd60b r7983: clean up some use of un-initialized variables found by valgrind
(This used to be commit 5f4a3f61a3)
2007-10-10 10:58:06 -05:00
Jeremy Allison
19ca97a70f r7882: Looks like a large patch - but what it actually does is make Samba
safe for using our headers and linking with C++ modules. Stops us
from using C++ reserved keywords in our code.
Jeremy
(This used to be commit 9506b8e145)
2007-10-10 10:58:00 -05:00
Gerald Carter
fee4b03e02 r7692: start versioning the registry.tdb file since it can be modified now
(This used to be commit a091b37d59)
2007-10-10 10:57:19 -05:00
Gerald Carter
2129d3c711 r7691: * add .gdbinit to the svn:ignore files
* start adding write support to the Samba registry
  Flesh out the server implementations of
  RegCreateKey(), RegSetValue(), RegDeleteKey() and RegDeleteValue()

I can create a new key using regedit.exe now but the 'New Key #1'
key cannot be deleted yet.
(This used to be commit e188fdbef8)
2007-10-10 10:57:19 -05:00
Gerald Carter
e9e00ee9c2 r7620: when adding a new printer driver, we should copy the files
(not move) to the W32X86/{2,3}/ directory.  Printmig.exe
copies the driver files for all drivers to print$/W32X86
and the calls AddPrinterDriver() for each driver.  If we
move the file, then adding a driver which shares a file with
a previous driver will fail.

I can now restore drivers in bulk to a Samba 3 server.
(This used to be commit 46cd95c9b4)
2007-10-10 10:57:17 -05:00
Gerald Carter
f2f115c2a2 r7614: convert move_driver_to_download_area() to return WERROR in order to provide better error messages to clients when a AddPrinterDriver[Ex]() call fails
(This used to be commit c98e17446a)
2007-10-10 10:57:16 -05:00
Gerald Carter
9591510721 r7584: cleanup the default printer security descriptor
(This used to be commit 26387fc74c)
2007-10-10 10:57:15 -05:00
Jeremy Allison
ed5e7ff9f1 r7200: Don't use memset, use SET_STAT_INVALID (has the same effect).
Jeremy.
(This used to be commit 0b6f87d5e1)
2007-10-10 10:57:05 -05:00
Gerald Carter
eb8b02104e r7041: compile fixes....long day I guess
(This used to be commit ec3ef5ddbe)
2007-10-10 10:57:01 -05:00
Gerald Carter
4b417655f7 r7038: * upgrade version of nt*tdb files. Have to fix
some issues in the printer security descriptors.
  Ensure that each printer sd has an oaner and group SID
  (BUILTIN\Administrators) and that we utilize more than
  the generic bits assigned in <= 3.0.14a.
(This used to be commit c72182c1e2)
2007-10-10 10:57:01 -05:00
Volker Lendecke
83e11ba86c r6263: Get rid of generate_wellknown_sids, they are const static and initializable
statically.

Volker
(This used to be commit 3493d9f383)
2007-10-10 10:56:33 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Jeremy Allison
cc5ba986bf r5792: Added new parameter "inherit owner". If set on a share, the created file/directory
will be owned by the same uid as the containing directory. Doing this for directories
in a race-free mannor has only been tested on Linux (it depends on being able to open
a directory and then do a fchown on that file descriptor). If this functionality is
not available then the code silently downgrades to not changing the ownership of a
new directory. This new parameter (docs to follow) finally makes it possible to create
"drop boxes" on Samba, which requires all files within a directory to be commonly owned.
A HOWTO on how to use this will follow.
Jeremy.
(This used to be commit 2e1f727184)
2007-10-10 10:56:01 -05:00
Gerald Carter
aaa4a660ac r5683: BUG 2363: allow 'in use' driver to be removed as long as one 'Windows NT x86' driver remains'
(This used to be commit 743ddbc7f2)
2007-10-10 10:55:54 -05:00
Gerald Carter
3bb69bc8ef r5029: after talking to Rob, ensure that we set the NETIOSNAME.domainname
as the longname in the published printer information since this
is what we will have used when we joined the domain.

More testing on this tomorrow.
(This used to be commit d64fd1116d)
2007-10-10 10:55:12 -05:00
Gerald Carter
3947f33ec5 r4874: add DOmain Admins (Full Control) to the default printer sd if we are a DC
(This used to be commit 8971a85442)
2007-10-10 10:55:06 -05:00
Gerald Carter
46e5effea9 r4805: Last planned change to the privileges infrastructure:
* rewrote the tdb layout of privilege records in account_pol.tdb
  (allow for 128 bits instead of 32 bit flags)
* migrated to using SE_PRIV structure instead of the PRIVILEGE_SET
  structure.  The latter is now used for parsing routines mainly.

Still need to incorporate some client support into 'net' so
for setting privileges.  And make use of the SeAddUserPrivilege
right.
(This used to be commit 41dc7f7573)
2007-10-10 10:53:55 -05:00
Gerald Carter
2c33c41b0c r4740: allow SE_PRINT_OPERATORS to have printer admin access
(This used to be commit 85731706c9)
2007-10-10 10:53:53 -05:00
Gerald Carter
d097ea4905 r4539: patch from Rob -- adding real printcap name cache function to speed up printcap reloads
(This used to be commit 1cad525093)
2007-10-10 10:53:46 -05:00
Gerald Carter
7ab25a7ae1 r4089: fix logic error in add_a_form() that only compared N characters instead of the entire form name
(This used to be commit e3decbc441)
2007-10-10 10:53:32 -05:00
Jeremy Allison
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Jim McDonough
3e8e24c629 r3727: Update from Rob Foehl (rwf@loonybin.net):
Try modifying printer before adding it,since add logic appends ObjectClass to mods, which caused a contraint violation when modifying an already published printer.

Also cleanup the check_published_printers() logic when verifying published status on startup.
(This used to be commit 82eb168c82)
2007-10-10 10:53:16 -05:00
Gerald Carter
5c27f5fbc3 r3710: fix another safe_strcpy() warning SPAM with the printer drivcename
(This used to be commit 5eac16464d)
2007-10-10 10:53:15 -05:00
Gerald Carter
f3ea955b70 r3707: 2028: avoid false error messages when copying a long printer name to the device mode
(This used to be commit c9613214a5)
2007-10-10 10:53:15 -05:00
Gerald Carter
4e18fa46d5 r3069: add 'force printername' service parameter for people that want to enforce printername == sharename for spoolss printing
(This used to be commit d47b8a0b4f)
2007-10-10 10:53:00 -05:00
Gerald Carter
c53e6401eb r3049: fixing some calls in the printing code to stanard_sub_basic(); fix standard_sub_snum() to use the current user's gid; add some (snum == -1) checks to standard_sub_advanced()
(This used to be commit 8c3fd1908d)
2007-10-10 10:52:59 -05:00
Gerald Carter
534c4a2504 r2996: readability fix for length check; no semantic changes
(This used to be commit 668ab6984a)
2007-10-10 10:52:58 -05:00
Gerald Carter
7df1ed060b r2955: fixing a segfault uncovered by the changes for BUG 1519
(This used to be commit 1664395257)
2007-10-10 10:52:57 -05:00
Günther Deschner
2d016a67b8 r2821: Adding "Windows x64" as architecture string and driverdir "x64" for the
64bit AMD platform.

(This used to be "Windows AMD64" and "AMD64" in one of the release
candidates of SP2 for Windows XP. AMD64 is obviously still supported but
not documented.)

Guenther
(This used to be commit cc5892f041)
2007-10-10 10:52:53 -05:00
Gerald Carter
31441aaa13 r2768: BUG 1519: save the hostname used in the open_printer_ex() for later reuse when filling in the spolss replies (also gets rid of get_called_name()
(This used to be commit 57db8ca91f)
2007-10-10 10:52:52 -05:00
Gerald Carter
729155a428 r2570: minor fix with Rob's patch. use dos_errstr() instead of W_ERROR_V() when using %s in the format string
(This used to be commit b26e4dbd7f)
2007-10-10 10:52:46 -05:00
Gerald Carter
5a8effaaae r2569: Patch from Rob Foehl <rwf@loonybin.net>:
- fix typo in libads/ldap_printer.c:39, ads_find_printer_on_server()
  (originally libads-typo.patch)
- fix leak in printing/nt_printing.c, is_printer_published()
  (originally is_printer_published-leak.patch)
- fix double print_backend_init() calls, now only called from main()
- restructuring in printing/nt_printing.c
  - replaced (un)publish_it() with ads-specific functions
  - moved common code to nt_printer_publish()
  - improved error handling in several places
- added check_published_printers() in printing/nt_printing.c, to verify
  that each published printer is actually in the directory at startup
- changed calling semantics of mod_a_printer, dump_a_printer, and
  update_driver_init to be more consistent with the rest of the api and
  reduce some copying
(This used to be commit 50a5a3dbd0)
2007-10-10 10:52:46 -05:00
Gerald Carter
278f9467f2 r2133: Several fixes:
* BUG 1627: fix for NIS compiles on HPUX 11.00, AIX 4.3 and 5.1
  patch from Olaf Flebbe <o.flebbe@science-computing.de>.
  Will need to watch this one in the build farm.

* Fix bug found by rwf@loonybin.net where the PRINT_ATTRIBUTE_PUBLISHED
  was getting reset by attempts to sanitize the defined attributes
  (PRINTER_ATTRIBUTE_SAMBA)

* Resolve name conflict on DEC OSF-5.1 (inspired by patch from
  Adharsh Praveen <rprav@india.hp.com>)

* Work around parsing error in the print change notify code
  (not that the alignment bug is still there but reording the
   entries in the array works around it).

* remove duplicate declaration of getprintprocdir from rpcclient.
(This used to be commit 7474c6a446)
2007-10-10 10:52:32 -05:00
Gerald Carter
1842fde7d1 r1885: tighten the cache consistency with the ntprinters.tdb entry an the in memory cache associated with open printer handles; also make sure that register_messages_flags() doesn't overwrite the originally registers flags
(This used to be commit 540daf71d8)
2007-10-10 10:52:23 -05:00
Günther Deschner
60727acc3b r1692: first commit :)
* add IA64 to the architecture table of printer-drivers

* add new "net"-subcommands:

  net rpc printer migrate {drivers|printers|forms|security|settings|all}
        [printer]
  net rpc share migrate {shares|files|all} [share]

  this is the first part of the migration suite. this will will (once
  feature-complete) allow to do 1:1 server-cloning in the best possible way by
  making heavy use of samba's rpc_client-functions. all migration-steps
  are implemented as rpc/smb-client-calls; net communicates via rpc/smb
  with two servers at the same time (a remote, source server and a
  destination server that currently defaults to the local smbd). this
  allows e. g. printer-driver migration including driverfiles, recursive
  mirroring of file-shares including file-acls, etc. almost any migration
  step can be called with a migrate-subcommand to provide more flexibility
  during a migration process (at the cost of quite some redundancy :) ).

  "net rpc printer migrate settings" is still in a bad condition (many
  open questions that hopefully can be adressed soon).

  "net rpc share migrate security" as an isolated call to just migrate
  share-ACLs will be added later.

  Before playing with it, make sure to use a test-server. Migration is a
  serious business and this tool-set can perfectly overwrite your
  existing file/print-shares.

* along with the migration functions had to make I the following
  changes:

        - implement setprinter level 3 client-side

        - implement net_add_share level 502 client-side

        - allow security descriptor to be set in setprinterdata level 2
          serverside

guenther
(This used to be commit 8f1716a29b)
2007-10-10 10:52:19 -05:00
Jeremy Allison
2fc57c9a2c r1085: Now it's had some proper user testing, merge in the deferred open fix. I'm
still doing more testing, but it fixes a behaviour that we've been wrong
on ever since the start of Samba.
Jeremy.
(This used to be commit 894cc6d162)
2007-10-10 10:51:54 -05:00
Gerald Carter
509c71fef5 r783: fix bug in reading printer data from disk; all ow valuenames with embedded '\'s
(This used to be commit fdc1633c34)
2007-10-10 10:51:38 -05:00
Gerald Carter
0f462790a3 r689: removed unneeded forward declarations
(This used to be commit ae0a770d60)
2007-10-10 10:51:34 -05:00
Gerald Carter
72d124af9e r551: BUG 1293: fix double free in printer publishing code
(This used to be commit f9a371f33b)
2007-10-10 10:51:28 -05:00
Gerald Carter
5254c9b6b4 r543: possible fix for BUG 1293 -- initialize pointer to NULL to ensure the failure check is valid
(This used to be commit b7005e6989)
2007-10-10 10:51:28 -05:00
Jeremy Allison
683d27ff1e r460: Fix for broken driver upload/delete path processing.
Jeremy.
(This used to be commit 78be46d13b)
2007-10-10 10:51:24 -05:00
Gerald Carter
8ad3d8c9b0 r196: merging struct uuid from trunk
(This used to be commit 911a28361b)
2007-10-10 10:51:13 -05:00
Jeremy Allison
722aa118c6 Added per-share parameter "store dos attributes". When set, will store
dos attributes in an EA. Based on an original patch from tridge, but
modified somewhat to cover all cases.
Jeremy.
(This used to be commit ed653cd468)
2004-04-02 18:46:19 +00:00
Gerald Carter
cc98a35689 fixes for prnadmin.dll API
* force the PRINTER_ATTRIBUTE_LOCAL (nor PRINTER_ATTRIBUTE_NETWORK)
  * ensure that we return the sec_desc in smb_io_printer_info_2
    (allows prnui.dll to restore security descriptors from a data file).
(This used to be commit c335cb80d2)
2004-03-24 19:15:17 +00:00
Jeremy Allison
fba5a72249 Use a common function to parse all pathnames from the wire. This allows
much closer emulation of Win2k3 error return codes.
Jeremy.
(This used to be commit c9f31fafed)
2004-03-03 20:55:59 +00:00
Jeremy Allison
2f2e5b0191 Fix up name canonicalization (needed for krb5 keytab support later).
Remove source_env handler (no longer used in any codepath).
Jeremy.
(This used to be commit 3a3e336030)
2004-01-30 18:38:48 +00:00
Andrew Bartlett
5eee23cc64 auth/auth_util.c:
- Fill in the 'backup' idea of a domain, if the DC didn't supply one.  This
   doesn't seem to occour in reality, hence why we missed the typo.

lib/charcnv.c:
lib/smbldap.c:
libads/ldap.c:
libsmb/libsmbclient.c:
printing/nt_printing.c:
 - all the callers to pull_utf8_allocate() pass a char ** as the first
   parammeter, so don't make them all cast it to a void **

nsswitch/winbind_util.c:
 - Allow for a more 'correct' view of when usernames should be qualified
   in winbindd.  If we are a PDC, or have 'winbind trusted domains only',
   then for the authentication returns stip the domain portion.
 - Fix valgrind warning about use of free()ed name when looking up our
   local domain.  lp_workgroup() is maniplated inside a procedure that
   uses it's former value.  Instead, use the fact that our local domain is
   always the first in the list.

Andrew Bartlett
(This used to be commit 494781f628)
2003-12-31 00:31:43 +00:00
Gerald Carter
318190580d Move to short lived TALLOC_CTX* for allocating printer
objects from the print handle cache.   Fixes bug that
caused smbd to consume large amounts of RAM when

(a) a printer handle was kept open over an extended
    period of time, and
(b) the client issued frequent requests that resulted
    in a call to get_a_printer()
(This used to be commit 10b9976e0a)
2003-12-30 22:17:14 +00:00
Tim Potter
fbb8f131c2 Fix more 64-bit printf warnings.
(This used to be commit 23443e3aa0)
2003-11-03 14:34:25 +00:00
Jeremy Allison
231124ced9 Fixes to check for wraps which could cause coredumps.
Jeremy.
(This used to be commit ad06edd1bb)
2003-10-29 21:28:00 +00:00
Gerald Carter
611b198743 make sure we have a devmode before copying a string to the devicename; patch from metze
(This used to be commit 1700e83ac8)
2003-10-20 14:02:02 +00:00
Jeremy Allison
0551426657 Ensure that dup_sec_desc copies the 'type' field correctly. This caused
me to expose a type arguement to make_sec_desc(). We weren't copying
the SE_DESC_DACL_AUTO_INHERITED flag which could cause errors on
auto inherited checks.
Jeremy.
(This used to be commit 28b315a750)
2003-09-19 21:57:43 +00:00
Jeremy Allison
ca1c6ebb11 Fix a nasty mess, and also bug #296. passdb/pdb_ldap.c was not converting
to/from utf8 for some calls. The libads code gets this right. Wonder why
the passdb code doesn't use it ?
Jeremy.
(This used to be commit 910d21d316)
2003-09-10 22:33:06 +00:00
Jeremy Allison
94f59f5492 More tuning from cachegrind. Change most trim_string() calls to trim_char(0,
as that's what they do. Fix string_replace() to fast-path ascii.
Jeremy.
(This used to be commit f35e9a8b90)
2003-09-05 19:59:55 +00:00
Gerald Carter
14eb5f108e make sure the printer data value exists before saying you deleted it
(This used to be commit 017133ea0c)
2003-08-25 13:05:48 +00:00
Gerald Carter
983b4e7011 it never amazes me when some new things crawls out of the windows
spooler. :-(

When installing the Adobe PS driver onto a Samba printer via cupsaddsmb,
I noticed a WIN2k client sending DeletePrinterData("DependentFiles")
pver and over.  I also noticed that we never checked to see if the
value was valid.  No now we do and return WERR_BADFILE which I think
is correct.

Next, I noticed that we never wrote the updated printer out to disk
after a succesfully DeletePrinterData[Ex]().

Finally, I found a driver (Canon BJC 1000 using the Adobe PS drivers
and foomatic PPD file) that was destroying the device name string
in the devmode.  So now get_a_printer_2() always writes out the
device name in \\server\share form.

I think these changes might fix bug 294.
(This used to be commit deb2578087)
2003-08-23 03:34:24 +00:00
Gerald Carter
bd886acab8 stupid...stupid...stupid....fix bug 294 by looking at the right arch string
(This used to be commit 584df6b8d6)
2003-08-16 01:40:38 +00:00
Herb Lewis
aa39cc37da get rid of more compiler warnings
(This used to be commit 398bd14fc6)
2003-08-15 04:42:05 +00:00
Gerald Carter
9b80349a2f fix bug 294; win9x driver lookups should always use version 0
(This used to be commit 8cc1a49c13)
2003-08-14 20:51:41 +00:00
Gerald Carter
eb2b683022 fix cache coherency bug in print handle print_info_2 cache.
Needs to be rewritten to use a reference counter, but this
will work for now.

also the memory allocation in the printing code needs to be cleaned
up to use talloc exclusively.
(This used to be commit 3d29302756)
2003-07-14 19:51:34 +00:00
Gerald Carter
f414539d86 ifdef out some functions that are not used when HAVE_ADS is not defined
(This used to be commit 2d192e0431)
2003-06-25 19:49:27 +00:00
Gerald Carter
f51d769dd3 large change:
*)  consolidates the dc location routines again (dns
    and netbios)  get_dc_list() or get_sorted_dc_list()
    is the authoritative means of locating DC's again.

    (also inludes a flag to get_dc_list() to define
     if this should be a DNS only lookup or not)

    (however, if you set "name resolve order = hosts wins"
     you could still get DNS queries for domain name IFF
     ldap_domain2hostlist() fails.  The answer?  Fix your DNS
     setup)

*)  enabled DOMAIN<0x1c> lookups to be funneled through
    resolve_hosts resulting in a call to ldap_domain2hostlist()
    if lp_security() == SEC_ADS

*)  enables name cache for winbind ADS backend

*)  enable the negative connection cache for winbind
    ADS backend

*)  removes some old dead code

*)  consolidates some duplicate code

*)  moves the internal_name_resolve() to use an IP/port pair
    to deal with SRV RR dns replies.  The namecache code
    also supports the IP:port syntax now as well.

*)  removes 'ads server' and moves the functionality back
    into 'password server' (which can support "hostname:port"
    syntax now but works fine with defaults depending on
    the value of lp_security())
(This used to be commit d7f7fcda42)
2003-06-25 17:41:05 +00:00
Tim Potter
add20d8f8f Squash another compiler warning.
(This used to be commit 8b20883435)
2003-05-27 07:29:13 +00:00
Alexander Bokovoy
bc2a3748e9 Prefix VFS API macros with SMB_ for consistency and to avoid problems with VFS_ macros at system side. We currently have one clash with AIX and its VFS_LOCK. Compiled and tested -- no new functionality or code, just plain rename of macros for yet-unreleased VFS API version. Needs to be done before a24 is out
(This used to be commit c2689ed118)
2003-05-14 10:59:01 +00:00
Alexander Bokovoy
e7c8c15888 Fix VFS layer:
1. Finally work with cascaded modules with private data storage per module
2. Convert VFS API to macro calls to simplify cascading
3. Add quota support to VFS layer (prepare to NT quota support)

Patch by Stefan (metze) Metzemacher, with review of Jelmer and me
Tested in past few weeks. Documentation to new VFS API for third-party developers to follow
(This used to be commit 91984ef5ca)
2003-05-11 23:34:18 +00:00
Andrew Bartlett
376b8d57ee Elsewhere, we use a #define for this environment variable name, so do the
same here.

Andrew Bartlett
(This used to be commit a4556786d2)
2003-05-09 09:37:12 +00:00
Jim McDonough
fda7b4b226 Get credentials before publishing printers.
(This used to be commit 674174fcca)
2003-04-25 21:51:26 +00:00
Andrew Bartlett
2a3a9f0bf4 Merge the 'safe' parts of my StrnCpy patch - many of the users really wanted
a pstrcpy/fstrcpy or at most a safe_strcpy().

These have the advantage of being compiler-verifiable.

Get these out of the way, along with a rewrite of 'get_short_archi' in the
spoolss client and server.  (This pushes around const string pointers, rather
than copied strings).

Andrew Bartlett
(This used to be commit 32fb801ddc)
2003-04-23 13:27:35 +00:00
Tim Potter
862c88d810 Array size fixup for construct_nt_devicemode() from HEAD.
(This used to be commit 5d1e8cca03)
2003-04-14 03:50:38 +00:00
Jeremy Allison
a3d7a1ea20 Fix off by one bug noticed by Andrew Bartlett.
Jeremy.
(This used to be commit 759aab9944)
2003-03-14 02:10:26 +00:00
Gerald Carter
ccb58b303a add #define for the max device name length in a DEVICEMODE
(This used to be commit 52ef84b534)
2003-03-06 16:09:11 +00:00
Jeremy Allison
d45fe965ef Writable string const fixes.
Jeremy.
(This used to be commit c832e95c2f)
2003-03-05 01:30:15 +00:00
Gerald Carter
23b3b29eec Progress on CR 601
cache the printer_info_2 with the open printer handle.
cache is invalidated on a mod_a_printer() call **on that smbd**.

Yes, this means that the window for admins to step on each other
from different clients just got larger, but since handles a generally
short lived this is probably ok.
(This used to be commit 31272d3b6b)
2003-02-25 20:53:53 +00:00
Andrew Bartlett
e075e1dfa9 Missed one in the previous merge - user_ok() and user_in_group() now take
an optional list of groups the user is in.
(This used to be commit 39f3bec0f6)
2003-02-24 02:47:14 +00:00
Gerald Carter
940fcdf095 * set PRINTER_ATTRIBUTE_RAW_ONLY; CR 1736
* never save a pointer to an automatic variable (they go away)
  implement a deep copy for SPOOLSS_NOTIFY_MSG to correct
  messages being sent that have junk for strings;
  fix in response to changes for CR 1504
(This used to be commit ffda9e2480)
2003-02-15 23:33:30 +00:00
Gerald Carter
99cdb46208 *lots of small merges form HEAD
*sync up configure.in
*don't build torture tools in make all
*make sure to remove torture tools as part of make clean
(This used to be commit 0fb724b321)
2003-01-15 18:57:41 +00:00
Andrew Bartlett
27b7e51a3c Merge from HEAD:
- fstring/pstring mixups
 - the detection code that found them (disabled)
 - a bit of whitespace
 - a static

Andrew Bartlett
(This used to be commit 9b70fa868e)
2003-01-14 08:53:59 +00:00
Andrew Bartlett
634c54310c Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
(This used to be commit 3a7458f947)
2003-01-03 08:28:12 +00:00
Jeremy Allison
ef8bd7c4f7 Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
(This used to be commit 09a218a9f6)
2002-12-20 20:21:31 +00:00
Jim McDonough
f201af1925 Store printer guid in the dsspooler registry key so we don't have to
query the directory server every time someone asks
(This used to be commit dd81003bdd)
2002-12-13 21:56:34 +00:00
Jim McDonough
81a2a30739 More printer publishing code.
- Add published attribute to info2, needed for win clients to work properly
- Return proper info on getprinter 7

This means you can now look at the sharing tab of a printer and get correct
info about whether it is published or not, and change it.
(This used to be commit d57bddc9b2)
2002-12-13 19:01:27 +00:00
Jim McDonough
26236b30d0 More printer data to publish
(This used to be commit 6e2f0c4e30)
2002-12-05 19:13:40 +00:00
Jeremy Allison
14662de563 Janitor for tpot yet again... Merging in memory leak fix.
Jeremy.
(This used to be commit 6ce50ffcda)
2002-12-04 21:28:11 +00:00
Jim McDonough
dae62a3d2e Automatic printer publishing when using APW or choosing 'list in the directory' in printer settings. Currently very little is published, and you cannot unpublish because of a bug in win2k clients.
(This used to be commit ca6360e8db)
2002-12-04 17:40:50 +00:00
Jeremy Allison
de474974ea Lots of fixes for error paths where tdb_fetch() data need freeing.
Found via a post from Arcady Chernyak <Arcady.Chernyak@efi.com>.
Jeremy.
(This used to be commit 5d5762d178)
2002-11-23 02:52:36 +00:00
Jeremy Allison
8980fcf1ea Keeping branches in sync....
Jeremy.
(This used to be commit eb937761c4)
2002-11-07 07:13:29 +00:00
Jeremy Allison
a63844e10e Fix slowdown because of enumerating all print queues on every smbd startup.
Jeremy.
(This used to be commit 6efd17ef78)
2002-10-31 23:41:00 +00:00
Jeremy Allison
63eefb36f1 Check the long_archi name for NULL.
Jeremy.
(This used to be commit e504d1170d)
2002-10-31 18:42:38 +00:00
Gerald Carter
6ce3e3b10c removed the following parameters
* postscript
  * printer driver
  * printer driver location
  * printer driver file

also removed the get_a_printer_driver_9x_compatible() function
(This used to be commit 743f2b8025)
2002-10-21 20:11:12 +00:00
Jeremy Allison
3665777a5b Add a timeout to tdb_lock_bystring(). Ensure we never have more than
MAX_PRINT_JOBS in a queue.
Jeremy.
(This used to be commit 9fe3c0b90d)
2002-10-04 22:53:18 +00:00
Gerald Carter
a834a73e34 sync'ing up for 3.0alpha20 release
(This used to be commit 65e7b5273b)
2002-09-25 15:19:00 +00:00
Jelmer Vernooij
669a39fae3 Sync 3.0 branch with HEAD
(This used to be commit eac75549c3)
2002-08-17 16:31:24 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Tim Potter
fea03cef2b Merge of print server permission handling fixes from HEAD.
(This used to be commit 62ee1f8c3f)
2002-04-15 03:49:53 +00:00
Gerald Carter
e1e8c5b396 removed unnecessary memset
(This used to be commit 233a24792e)
2002-04-11 03:15:02 +00:00
Gerald Carter
b40e73e2ca specversion merge from SAMBA_2_2
(This used to be commit d87aa35d48)
2002-04-11 01:48:38 +00:00
Tim Potter
ce236d1dbf Stomped on some header file version numbers that have crept back in.
(This used to be commit e66bdf1229)
2002-03-22 06:24:38 +00:00
Tim Potter
a4cce223d6 Added dos_errstr() function. Not all errors in list yet.
(This used to be commit ddb5753e36)
2002-03-17 06:04:15 +00:00
Gerald Carter
65c007b583 syncing up printing code with SAMBA_2_2 (already done some merges
in the reverse).

  * add in new printer change notify code from SAMBA_2_2

  * add in se_map_standard() from 2.2 in _spoolss_open_printer_ex()

  * sync up the _print_queue_struct in smb.h (why did someone change the
    user/file names in fs_user/fs_file (or vice-versa) ? )

  * sync up some cli_spoolss_XXX functions
(This used to be commit 5760315c1d)
2002-03-15 08:14:10 +00:00
Tim Potter
8975d3ef70 Backed out enumprinters stuff - leave it for another day.
(This used to be commit d7efc5dd3d)
2002-03-14 01:48:59 +00:00
Tim Potter
92e59edc41 Merge of enumprinters vs getprinter naming patch from 2.2
(This used to be commit dfd51bc8d0)
2002-03-12 00:16:03 +00:00
Jeremy Allison
9d975fa6bc Fix from JohnR - Fixed SetPrinterData(magic key) to support zero length DEVMODE as is the case with the
Okidata Okipage 20 PCLXL Advanced printer driver.
(This used to be commit 51c3d35363)
2002-02-27 22:40:12 +00:00
Gerald Carter
2ef886855c merge from 2.2
(This used to be commit 9e96cbe241)
2002-02-19 02:10:08 +00:00
Jeremy Allison
03cfb31ad9 Bring printing in HEAD inline with 2.2.x and app-head.
Jeremy.
(This used to be commit 771ef92fc6)
2002-02-09 04:10:24 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Gerald Carter
485b4ff5ec merge from APPLIANCE_HEAD
(This used to be commit e3b87ffc8c)
2002-01-26 22:27:12 +00:00
Andrew Bartlett
a7b5354078 These changes commited on a 'no less broken' basis.
The previous code attempted to call winbind to find out the domain sid.  This
couldn't work for a number of reasons - not the least of which was that both
the client and server ends would reject any name (in this case domain name)
without a \ in it (or lp_winbind_seperator()).

I think this is what was intended to occour.  If there is still some need to
contact winbind for this information, I suggest a new call be created for this
- as it the server-side code doesn't allow for this information to be extracted
easily in any case.

Finally, it gets in the way of the default domain code a bit - hence why I was
actually looking at it...

Andrew Bartlett
(This used to be commit 5fe1ea7f11)
2002-01-26 06:02:28 +00:00
Andrew Bartlett
38ac78c3df Change this code so that we don't do a lookup_name() on root.
This matches the lookup failure case in 2.2, and seems to make more sense than
giving the printer to 'world'.  (Avoiding this lookup makes some of my other
changes - including winbind default domains - a little easier).

In any case, tpot has promised to look at this and test it when he gets back to
work. :-)

Andrew Bartlett
(This used to be commit f0137ac126)
2002-01-25 22:44:21 +00:00
Gerald Carter
e710c07411 merge from 2.2
(This used to be commit 8ed7c1ffad)
2002-01-23 05:10:27 +00:00
Gerald Carter
528ff0d6f7 merge from 2.2. of
* PRINTER_ATTRIBUTE's
  * "default devmode" parameter
(This used to be commit 90a7a1840b)
2002-01-22 18:14:31 +00:00
Jeremy Allison
1d40138232 Round and round we go....
Jeremy.
(This used to be commit 2603ab3c68)
2002-01-11 23:33:12 +00:00
Jeremy Allison
b741f6b04c Latest attempt at changeid.
Jeremy.
(This used to be commit 24ee18c77e)
2002-01-11 21:52:46 +00:00
Jeremy Allison
a842a3d458 When re-writing tdb version numbers as little endian int32, we must
change the version number also.
Jeremy.
(This used to be commit 3dec9cf99a)
2002-01-09 05:24:07 +00:00
Jeremy Allison
91536cc901 Fixed all uses of tdb_fetch/store/_int to use explicit int32 little endian
in tdb's. All except winbindd_idmap.... Hmmmmmm.
Jeremy.
(This used to be commit ec71f1732b)
2002-01-09 04:13:30 +00:00
Jeremy Allison
eca00cab66 My previous fix had a bug....
This is SO NASTY as some drivers need this to change, others need it
static. This value will change every second, and I must hope that this
is enough..... DON'T CHANGE THIS CODE WITHOUT A TEST MATRIX THE SIZE OF
UTAH !
Jeremy.
(This used to be commit 9fb780d951)
2002-01-08 23:50:14 +00:00
Jeremy Allison
bbc42672a2 Another attempt at getting changeid correct. Jerry / JF please check !
This fixes a driver init bug.
Jeremy.
(This used to be commit 8e8d718160)
2002-01-08 05:39:27 +00:00
Jeremy Allison
b19ec04f52 Caught one problem where a BOOL fn was returning 3 different values :-).
Roll on defined types :-).
Jeremy.
(This used to be commit ccf07e2184)
2002-01-08 01:22:23 +00:00
Jeremy Allison
4702494dce Added get_called_name() function, which replaces global_myname in printing
code (one less global, hurrah !) - to allow NetBIOS aliasing to be used
with point and print.
Jeremy.
(This used to be commit 10d72f0b01)
2002-01-08 00:46:56 +00:00
Jeremy Allison
43b27771f5 Return called NetBIOS name if present in preference to global_myname.
Should allow print servers to work with NetBIOS aliases.
Needs testing.
Jeremy.
(This used to be commit ee8fd2690a)
2002-01-07 22:58:20 +00:00
Tim Potter
17729f5dc5 Sed error. The status value in the PRINTER_INFO_2 structure isn't a WERROR
but a plain old uint32.
(This used to be commit 690cc12bad)
2002-01-07 06:13:40 +00:00
Jeremy Allison
eca99f5c22 Fixed nasty cast of tdb_delete in traversals.
Jeremy.
(This used to be commit a0cdec3acc)
2002-01-03 22:48:48 +00:00
Jeremy Allison
11b14e8389 Removed extra lp_adduser() call.
Fixed up error returns in get_correct_cversion().
Jeremy.
(This used to be commit 7ce2d1fe37)
2001-12-29 20:29:43 +00:00
Gerald Carter
abcd1cad3a ChangeID fixe from APPLIANCE_HEAD
(This used to be commit 096d06a961)
2001-12-14 20:38:04 +00:00
Martin Pool
e0adf6e27e Writing decimal constants as "02" has been shown to cause cancer in
rats.
(This used to be commit 142d3dad0a)
2001-12-03 02:30:27 +00:00
Tim Potter
6d9adfe73c Renamed sid field in SEC_ACE to trustee to be more in line with MS's
definitions.
(This used to be commit 9712d3f15a)
2001-11-30 01:04:15 +00:00
Tim Potter
abe6aff924 Merge from appliance-head: when creating a default security descriptor
for a printer, save it in ntprinters.tdb instead of recreating it
every time it is required.  This can save at least one winbind lookup
per secdesc creation.  Opening a port monitor and viewing the security
tab in the properties dialog required the security descriptor to be
returned 25 times!
(This used to be commit f85c976acc)
2001-11-26 03:39:16 +00:00
Andrew Tridgell
ad2974cd05 added "net join" command
this completes the first stage of the smbd ADS support
(This used to be commit 058a5aee90)
2001-11-24 14:16:41 +00:00
Gerald Carter
37a84c7bba merge oops fix from 2.2
(This used to be commit 48f2da440f)
2001-11-22 06:23:49 +00:00
Gerald Carter
116740a5df merge from 2.2
(This used to be commit 96b3a65a73)
2001-11-22 05:56:09 +00:00
Andrew Bartlett
60f0627afb This is a farily large patch (3300 lines) and reworks most of the AuthRewrite
code.

In particular this assists tpot in some of his work, becouse it provides the
connection between the authenticaion and the vuid generation.

Major Changes:
	- Fully malloc'ed structures.
	  - Massive rework of the code so that all structures are made and destroyed
	    using malloc and free, rather than hanging around on the stack.
	- SAM_ACCOUNT unix uids and gids are now pointers to the same, to allow them
	   to be declared 'invalid' without the chance that people might get ROOT by
	   default.

	- kill off some of the "DOMAIN\user" lookups.  These can be readded at a more
	  appropriate place (probably domain_client_validate.c) in the future. They
	  don't belong in session setups.

	- Massive introduction of DATA_BLOB structures, particularly for passwords.

	- Use NTLMSSP flags to tell the backend what its getting, rather than magic
	  lenghths.

	- Fix winbind back up again, but tpot is redoing this soon anyway.

	- Abstract much of the work in srv_netlog_nt back into auth helper functions.

This is a LARGE change, and any assistance is testing it is appriciated.

Domain logons are still broken (as far as I can tell) but other functionality
seems
intact.

Needs testing with a wide variety of MS clients.

Andrew Bartlett
(This used to be commit f70fb819b2)
2001-10-31 10:46:25 +00:00
Jeremy Allison
c416ff851b Merge the become_XXX -> change_to_XXX fixes from 2.2.2 to HEAD.
Ensure make_conection() can only be called as root.
Jeremy.
(This used to be commit 8d23a7441b)
2001-10-18 20:15:12 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00
Jeremy Allison
0f4281b9b4 Added Elrond patch to make se_access_check use NT datastructures, not Samba.
Jeremy.
(This used to be commit bca6419447)
2001-09-26 00:05:03 +00:00
Simo Sorce
091dbaa00b move to SAFE_FREE()
(This used to be commit 09bf442549)
2001-09-17 09:25:57 +00:00
Andrew Bartlett
06ccf1e499 Looks like it missed these. make_connection now no longer takes a 'username'
argument.
(This used to be commit 0e1322227b)
2001-09-15 23:32:19 +00:00
Andrew Tridgell
9a9ac2739b got rid of USE_TDB_MMAP_FLAG as its not needed any more
(This used to be commit c26e0d3f27)
2001-09-06 22:08:19 +00:00
Andrew Tridgell
19fea3242c the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but the client code still needs some work
(This used to be commit dcd6e735f7)
2001-09-04 07:13:01 +00:00
Andrew Tridgell
fbc1f326f4 more NTSTATUS/WERROR conversion
(This used to be commit ad648c5cd8)
2001-09-03 10:38:13 +00:00
Andrew Tridgell
fd6ea43161 the next step in our error code handling change
- added WERROR for win32 error codes
- added a configure test for immediate structures

still lots to do, so its not enabled by default, but the main
structure is there
(This used to be commit 24f9ab683d)
2001-09-03 08:50:59 +00:00
Andrew Tridgell
b031af348c converted another bunch of stuff to NTSTATUS
(This used to be commit 1d36250e33)
2001-08-27 19:46:22 +00:00
Herb Lewis
717533483b get rid of compiler warnings
(This used to be commit 0768991d04)
2001-08-24 20:32:01 +00:00
Simo Sorce
2e783a4707 this is a big global fix for the ptr = Realloc(ptr, size) bug.
many possible mem leaks, and segfaults fixed.

someone should port this fix to 2.2 also.
(This used to be commit fa8e55b8b4)
2001-08-12 17:30:01 +00:00
Jeremy Allison
4b2016305b Merge in the NT drivers changes from 2.2.
Jeremy.
(This used to be commit a3781ad38f)
2001-08-10 19:38:53 +00:00
Tim Potter
047a7c88d7 Replaced the duplicate DOS constants with appropriate ones from doserr.h to
emphasise the fact that the spoolss pipe returns DOS error codes instead of
32-bit nt status codes.
(This used to be commit 5f5ed41ee8)
2001-08-10 05:41:53 +00:00
Jeremy Allison
a62c6e81fc Fixup error returns in updating driver db version.
Jeremy.
(This used to be commit 5bd39ce233)
2001-07-30 23:12:48 +00:00
Jeremy Allison
996719cce2 Added "use mmap" for HPUX.
Jeremy.
(This used to be commit 840802f106)
2001-07-30 22:21:31 +00:00
Tim Potter
648528196c Held a shoot-out between NT_STATUS_NO_PROBLEMO and NT_STATUS_NOPROBLEMO.
According to the incorruptible judges find and grep, the latter won.

Mmm - procrastination.  (-:
(This used to be commit 2e33940360)
2001-07-25 06:42:05 +00:00
Jeremy Allison
11837682c7 Fix from Jim Vopni - muliple definitions of "letter".
Jeremy.
(This used to be commit 5aa3b18f69)
2001-07-16 19:36:44 +00:00
Tim Potter
afa7300006 Changed instances of TRUE, FALSE to True, False as some compilers don't
have the first set of symbols.
(This used to be commit ad0cbfbd79)
2001-07-12 22:27:00 +00:00
Tim Potter
65e373ec07 Removed unused local variables.
(This used to be commit fa1dfb681b)
2001-07-10 00:02:40 +00:00
Jean-François Micouleau
5512332cdb split the nt_drivers.tdb in 3 separate tdb files. Should speed-up lookups
J.F.
(This used to be commit c08e22713e)
2001-07-09 18:19:04 +00:00
Andrew Tridgell
527e824293 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn.
(This used to be commit c41fc06376)
2001-07-04 07:36:09 +00:00
Andrew Tridgell
87fbb7092b The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
(This used to be commit debb471267)
2001-07-04 07:15:53 +00:00
Jeremy Allison
ed2fc96222 Fixed extra file_free calls - my fault :-(.
Jeremy.
(This used to be commit 2f8b84bda0)
2001-07-02 18:37:39 +00:00
Herb Lewis
c2cfcb34e1 SGI compiler fixes.
Jeremy
(This used to be commit 45bf995bf6)
2001-06-26 20:23:45 +00:00
Jeremy Allison
b08ee8995d Fix from "Jim McDonough" <jmcd@us.ibm.com>" - when we use open_file_shared(),
we need to close with close_file().
Jeremy.
(This used to be commit 5b2ffd160f)
2001-06-22 18:58:35 +00:00
Andrew Tridgell
05fc3e578c use LDSHFLAGS not -shared in several places
(This used to be commit 8ec9c87b5d)
2001-06-04 05:13:59 +00:00
Gerald Carter
43000d8d06 merge from 2.2 (deleteprinterdriver RPC)
(This used to be commit 515caaf7b4)
2001-05-18 04:11:17 +00:00
Tim Potter
469bddf537 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 8b435b0a2a)
2001-05-10 01:01:30 +00:00
Jeremy Allison
1475474425 Merging Gerald's "no printer driver" fix from 2.2.
Jeremy.
(This used to be commit 409b1e4d1b)
2001-05-03 02:51:08 +00:00
Jeremy Allison
c11887e325 More debug %d -> %u issues.
Jeremy.
(This used to be commit 6fcb600dcd)
2001-04-27 22:17:10 +00:00
Jeremy Allison
607d5d508d Added per-share security tdb. Tidied up many slprintfs (need -1 on length).
Jeremy.
(This used to be commit d786191bc1)
2001-04-08 20:01:51 +00:00
Jeremy Allison
da8731e271 Sync up with new NT forms code.
Jeremy.
(This used to be commit 63ce316d87)
2001-04-03 22:41:31 +00:00
Jeremy Allison
a447217509 Two OS/2 printer fixes from Jim McDonough @ IBM.
First one adds a new info level into the lanman printing and an ioctl to the trans2 code.
    Andrew - this uses ASCII only. It looks ok to me but please check !
Second one adds a parameter "os2 driver map" that allows OS/2 driver names to be mapped.
Jeremy.
(This used to be commit da79b519e0)
2001-03-23 03:12:58 +00:00
Jeremy Allison
da3053048c Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMR
RPC code to merge with new passdb code.
Currently rpcclient doesn't compile. I'm working on it...
Jeremy.
(This used to be commit 0be41d5158)
2001-03-11 00:32:10 +00:00
Jeremy Allison
00ab9021b0 Serious (and I *mean* serious) attempt to fix little/bigendian RPC issues.
We were reading the endainness in the RPC header and then never propagating
it to the internal parse_structs used to parse the data.
Also removed the "align" argument to prs_init as it was *always* set to
4, and if needed can be set differently on a case by case basis.
Now ready for AS/U testing when Herb gets it set up :-).
Jeremy.
(This used to be commit 0cd37c831d)
2001-03-09 23:48:58 +00:00
Jeremy Allison
93169a1f34 Roll back to using malloc/realloc on some of spoolss in head.
I'm having problems with talloc_realloc in the 2.2 branch and I
want a stable reference.

The only problem is this breaks the clean auto-generated code
in *one* call in srv_spoolss.c (the rfnpcnex call).

Jeremy.
(This used to be commit 57a9340cba)
2001-03-03 05:27:26 +00:00
Jeremy Allison
74294f5a96 Move to talloc controlled NT forms.
Jeremy.
(This used to be commit 3e190e6933)
2001-03-02 00:20:43 +00:00
Jeremy Allison
5161c61bc7 Fixed a couple of getpwXX calls that were not going through the sys_getpwXX
cache.
Jeremy.
(This used to be commit a648935ae9)
2001-03-01 05:21:19 +00:00
Jeremy Allison
0f2799aaf1 Move to talloc control of SPOOL_XXX structs. Move to talloc control of
security descriptors and pointers. Syncup with 2.2 tree.
Jeremy.
(This used to be commit 14d5997dc8)
2001-02-28 00:51:02 +00:00
Jeremy Allison
94fc44a93c Merge of JohnR's changes to appliance-head, JF's changes to 2.2,
updated the POSIX_ACL code to be in sync.
Jeremy.
(This used to be commit c0517d6f4e)
2001-02-12 16:18:02 +00:00
David O'Neill
2506c61ab3 Changes from APPLIANCE_HEAD:
source/include/proto.h
        - make proto

    source/printing/nt_printing.c
    source/rpc_server/srv_spoolss_nt.c
        - Fix for the overwriting of printerdata entries when WinNT and
          Win2k are modifying printer parameters on PCL printers. Turns out
          that Win2k creates a printer with a NULL devmode entry and then
          expects to set it on *OPEN* (yes this is insane). So we cannot
          return a "default" devmode for a printer - and we must allow an
          open to set it.

    source/tdb/tdb.c
        - Show freelist in an easier format. Show total free.
        - When storing a new record, allocate memory for the key + data
          before the tdb_allocate() as if the malloc fails a (sparse) hole
          is left in the tdb.

    source/tdb/tdbtool.c
        - Show freelist in an easier format. Show total free.

    source/tdb/Makefile
        - cleaned up Makefile dependancies

    source/smbd/lanman.c
        -  Fix for Win9x corrupting it's own parameter string.

    source/printing/printfsp.c
    source/printing/printing.c
    source/rpc_server/srv_spoolss_nt.c
    source/smbd/close.c
        - Added normal close parameter into print_fsp_end() which treats an
          abnormal close as error condition and deletes the spool file.
(This used to be commit 025f7a092a)
2001-01-29 21:34:08 +00:00
David O'Neill
221926402a Changes from APPLIANCE_HEAD:
source/printing/nt_printing.c
        - fix for Win2k sending NULL devicemode in setprinter calls which
          was making NT4 grumpy.  The solution is to never set a NULL
          devicemode if we previously had a valid one in the printer's TDB
          entry.
(This used to be commit b9036a0778)
2001-01-26 18:13:17 +00:00
David O'Neill
a5b27e9cea Changes from APPLIANCE_HEAD:
source/printing/nt_printing.c
        - use se_create_child_secdesc() to create appropriate security
          descriptor when performing print job admin security checks.

    source/printing/printing.c
        - Use JOB_ACCESS_ADMINISTER instead of PRINTER_ACCESS_ADMINISTER in
          print_job_{delete,pause,resume}()
        - If stat'ing the job file fails, delete the job from printing.tdb
        - In print_job_end() check lpq cache time and do a
          print_queue_update() This prevents printing.tdb from growing when
          using NT/2K clients, and there isn't someone pressing F5 in a
          port monitor window.
        - In print_queue_resume() check lpq cache time and do a
          print_queue_update() Probably should do it for print_job_resume()
          too.
(This used to be commit 0068b7741f)
2001-01-19 16:57:39 +00:00
David O'Neill
792ca5d989 Changes from APPLIANCE_HEAD:
source/rpc_server/srv_spoolss_nt.c
        - Unrolled construct_notify_jobs_info() loop to only fetch
          printer info_2 structure once rather than num_print_jobs times.
        - convert command to unix codepage.
        - remove lp_remove_service() call as it prevents lp_killservice()
          from working.
        - Modified some DEBUG and DEBUGADD statements.

    source/param/loadparm.c
    source/param/params.c
        - change printer, preload, auto services to FLAG_DOS_STRING,
          reverted earlier changes to szPrintername et al, add comments.

    source/printing/load.c
        - fix bug with lp_auto_services() and strtok()

    source/printing/nt_printing.c
    source/printing/printing.c
        - remove redundant test that used SERVICE(snum)

    source/printing/pcap.c
        - add unix_to_dos() calls, add notes wrt FIXMEs for
          xxx_printer_fn() functions.

    source/web/swat.c
        - added FIXME comment.

    source/smbd/service.c
        - added comment re: dos codepage
(This used to be commit 7b774b72c2)
2001-01-17 18:47:46 +00:00
David O'Neill
3380ffae9c Changes from APPLIANCE_HEAD:
testsuite/printing/psec.c
        - Use lock directory from smb.conf parameter when peeking at the
          ntdrivers.tdb file.
    source/rpc_parse/parse_sec.c
        - fix typo in debug message
    source/script/installbin.sh
        - create private directory as part of 'make install'.
    source/nsswitch/winbindd_cache.c
    source/nsswitch/winbindd_idmap.c
    source/passdb/secrets.c
    source/smbd/connection.c
        - always convert tdb key to unix code-page when generating.
    source/printing/nt_printing.c
        - always convert tdb key to unix code-page when generating.
        - don't prepend path to a filename that is NULL in
          add_a_printer_driver_3().
    source/rpc_server/srv_spoolss_nt.c
        - always convert tdb key to unix code-page when generating.
        - don't prepend server name to a path/filename that is NULL in the
          fill_printer_driver_info functions.
    source/printing/printing.c
        - always convert tdb key to unix code-page when generating.
        - move access check for print_queue_purge() outside of job delete
          loop.
    source/smbd/unix_acls.c
        - fix for setting ACLs (this got missed earlier)
    source/lib/messages.c
        - trivial sync with appliance_head
(This used to be commit 376601d17d)
2001-01-11 20:41:19 +00:00
David O'Neill
23807f2b30 Changes from APPLIANCE_HEAD:
source/Makefile.in
        - changes to ctags and etags rules that somehow got lost along the way.

    source/include/proto.h
        - make proto

    source/smbd/sec_ctx.c
    source/smbd/password.c
        - merge debugs for debugging user groups and NT token stuff.

    source/lib/util_str.c
        - capitalise domain name returned from parse_domain_user()

    source/nsswitch/wb_client.c
        - fix broken conditional in debug statement.

    source/include/rpc_secdes.h
    source/include/rpc_spoolss.h
    source/printing/nt_printing.c
    source/lib/util_seaccess.c
        - fix printer permission bugs related to ACE masks for printers.
          This adds mapping of generic access rights to object specific
          rights for NT printers.  Still need to work out whether or not to
          ignore ACEs with certain flags set, though. See comments in
          util_seaccess.c:check_ace() for details.

    source/printing/nt_printing.c
    source/printing/printing.c
        - use PRINTER_ACCESS_ADMINISTER instead of JOB_ACCESS_ADMINISTER
          until we sort out printer/printjob permission stuff.
(This used to be commit 1dba9c5cd1)
2001-01-04 19:27:08 +00:00
Gerald Carter
b0a219686b merge from appliance head
(This used to be commit 393c5f14e0)
2000-12-21 23:38:47 +00:00
Jeremy Allison
452102deb4 Merged Tim's fixes from appliance-head.
Jeremy.
(This used to be commit 26f873540c)
2000-12-18 06:02:31 +00:00
Jeremy Allison
5c67f8de46 Added proto definition for new RPC calls.
Added printing fix from appliance-head.
Jeremy.
(This used to be commit f4c7f9ddb9)
2000-12-13 19:55:48 +00:00
Jeremy Allison
a95ccc2779 Adding in debug for SD's.
Jeremy.
(This used to be commit a19f936b64)
2000-12-11 19:24:59 +00:00
Jeremy Allison
b2d1c4fdee Sync-up with appliance-head printing code.
Jeremy.
(This used to be commit fe730614d7)
2000-12-06 00:37:25 +00:00
Andrew Tridgell
9b8a930f2c c++ style comments are NOT allowed
(This used to be commit 8b3c1f4455)
2000-12-04 03:01:31 +00:00
Andrew Tridgell
0e494d7ec6 no longer pass the type to make_sec_desc(), instead the type is
derived from the other arguments
(This used to be commit 9ec4b1fa48)
2000-12-04 01:58:22 +00:00
Jeremy Allison
0f1c800f85 passdb/secrets.c passdb/smbpassfile.c smbd/server.c : Actually *use* the code
written to transition from an old DOMAIN.MACHINE.MAC file to secrets.tdb.
printing/nt_printing.c: Fix case insensitive name lookups for driver files.
John - this should fix the Win9x/WinME problem correctly.
Jeremy.
(This used to be commit 8f3332a9ac)
2000-11-27 23:59:42 +00:00
Jeremy Allison
475fb713a9 Fix for memory leak when adding driver.
Jeremy.
(This used to be commit eeab4e0290)
2000-11-17 02:22:35 +00:00
Jeremy Allison
826c2f9269 Fix for incorrect break using wrong offset when updating a form.
Jeremy.
(This used to be commit 365c76e39d)
2000-11-17 00:31:29 +00:00
Jeremy Allison
14355a6434 Uninitialized memory read fixes.
open_file_shared takes a DOS pathname, not a UNIX one.
Jeremy.
(This used to be commit b2b59b93ff)
2000-11-15 02:39:11 +00:00
Jeremy Allison
4bce271e4f Merge from appliance head of JR's changes for driver versioning.
Jeremy.
(This used to be commit cdbd2e9977)
2000-11-14 21:56:32 +00:00
Jeremy Allison
e0bcc7ff54 printing/nt_printing.c: After long soul searching and making both Andrew and my
life a misery, here is the only possible null driver fix we have found.
		This *SUCKS*.
rpc_server/srv_spoolss_nt.c: Correct printername search. Correct portname reply
						Correct attributes reply. Removal of unused temp variable.
Jeremy.
(This used to be commit 06e71c9f8b)
2000-11-14 02:14:58 +00:00
Gerald Carter
9fede0dc0d Large commit which restructures the local password storage API.
Currently the only backend which works is smbpasswd (tdb, LDAP, and NIS+)
are broken, but they were somewhat broken before. :)

The following functions implement the storage manipulation interface

/*The following definitions come from  passdb/pdb_smbpasswd.c  */

BOOL pdb_setsampwent (BOOL update);
void pdb_endsampwent (void);
SAM_ACCOUNT* pdb_getsampwent (void);
SAM_ACCOUNT* pdb_getsampwnam (char *username);
SAM_ACCOUNT* pdb_getsampwuid (uid_t uid);
SAM_ACCOUNT* pdb_getsampwrid (uint32 rid);
BOOL pdb_add_sam_account (SAM_ACCOUNT *sampass);
BOOL pdb_update_sam_account (SAM_ACCOUNT *sampass, BOOL override);
BOOL pdb_delete_sam_account (char* username);

There is also a host of pdb_set..() and pdb_get..() functions for
manipulating SAM_ACCOUNT struct members.  Note that the struct
passdb_ops {} has gone away.  Also notice that struct smb_passwd
(formally in smb.h) has been moved to passdb/pdb_smbpasswd.c
and is not accessed outisde of static internal functions in this
file.  All local password searches should make use of the the SAM_ACCOUNT
struct and the previously mentioned functions.

I'll write some documentation for this later.  The next step is to fix
the TDB passdb backend, then work on spliting the backends out into
share libraries, and finally get the LDAP backend going.

What works and may not:

	o domain logons from Win9x 	works
	o domain logons from WinNT 4	works
	o user and group enumeration
		as implemented by Tim	works
	o file and print access		works
	o changing password from
		Win9x & NT		ummm...i'll fix this tonight :)

If I broke anything else, just yell and I'll fix it.  I think it
should be fairly quite.





-- jerry
(This used to be commit 0b92d0838e)
2000-11-13 23:03:34 +00:00
Jeremy Allison
c1900772ce printing/nt_printing.c: use getpwuid not smbgetpwuid. Canonicalize printernames.
printing/printing.c: Insure fix for malloc of zero.
rpc_parse/parse_misc.c: Enusre UNISTR's are zero filled.
rpc_parse/parse_spoolss.c: Correct INFO_6 - differs between pre-releases of W2K and shipping build.
rpc_server/srv_spoolss_nt.c: Canonicalize printernames.
Jeremy.
(This used to be commit b17e23a8ff)
2000-11-10 19:36:34 +00:00
Andrew Tridgell
3adc0e7a4e an attempt to get the handling of fields in printer info structures
consistent. Still working with Jeremy on this, there is probably more
to be done
(This used to be commit c4bb9c598c)
2000-11-08 03:12:16 +00:00
Tim Potter
8a190a9e46 Merge of printer security descriptor, info level and printerdata
comparison changes from appliance branch.
(This used to be commit ae087bdf31)
2000-11-07 02:54:50 +00:00
Jeremy Allison
cbe839f35c Sync up with Tim's changes in applience-head for SACLs.
Jeremy.
(This used to be commit 6b94273fc6)
2000-11-04 06:36:18 +00:00
Jeremy Allison
9a8749d33a Added John Reillys patch for error code returns from clean_up_printer_driver_strunct()
calls.
Jeremy.
(This used to be commit f81a2a03bf)
2000-10-26 22:09:22 +00:00
Jeremy Allison
b5ac72cc64 Sorry JF - no billable hours :-). I fixed the "stream of events" problem
with PCL drivers. The problem was we were updating the changeid on every
SETPRINTERDATA/DELETEPRINTERDATA call. We should not do this, we should
just update the 'setprinter' called count. We update the changeid on calls
to SETPRINTER/ADDPRINTER/ADDPRINTEREX etc. Also fixed the correct returning
of the create time on printers.
Jeremy.
(This used to be commit 521f09829f)
2000-10-26 21:43:13 +00:00
Jeremy Allison
2094856942 John Reilly @ HP (who is a wonderful human being and *definately* needs
CVS commit access :-) has written a simple routine that peeks inside the
MS PE printer driver file format and can tell if a driver is W2K or NT4.x.
So we can now correctly return the driver version number. Hurrah !
JF - this is the code you always wanted ..... :-) :-).
Jeremy.
(This used to be commit fd17374e6d)
2000-10-25 17:56:38 +00:00
Andrew Tridgell
2d33e87424 got rid of tdb_writelock() and instead lock a chain. tdb_writelock()
is conceptually flawed
(This used to be commit 6e4a358552)
2000-10-10 06:45:09 +00:00
Jeremy Allison
641d9223d2 utils/smbcontrol.c: Fixes from Herb for interactive use.
printing/nt_printing.c: No C++ comments please :-).
Jeremy.
(This used to be commit dd9f668108)
2000-09-29 20:08:00 +00:00
Jeremy Allison
9e039698c1 Fix from John Reilly for forms ordering problems.
Jeremy.
(This used to be commit 837839eb3d)
2000-09-28 21:33:08 +00:00
Herb Lewis
670d4984d5 fix for IRIX 6.2 compiler error
(This used to be commit eecee22bf1)
2000-09-26 23:28:04 +00:00
Jeremy Allison
ccddd111c6 Move towards getting W2k p&p to upload NT4.x drivers. Still doesn't work -
not sure why (JF - a glance at this would be appreciated). Removed code
that JF objected to with enumprinterdata. Added translations to/from
level 6 - but Win2k still not happy... hmmm...
Jeremy.
(This used to be commit e5d98ba9e9)
2000-09-15 00:15:10 +00:00
Jeremy Allison
94028a54b2 Ensure old DACL and SACL are preserved if the new SD is a 'set' only.
Jeremy.
(This used to be commit 29f41d0d95)
2000-09-13 22:01:15 +00:00
Jeremy Allison
c1d25bdb0c Added time check test before allowing print job.
Jeremy.
(This used to be commit 0249de4cd9)
2000-09-13 02:24:35 +00:00
Tim Potter
6ab4544738 Added missing break statement for manage documents check in
print_access_check() function.
(This used to be commit 318ead783c)
2000-09-13 01:18:01 +00:00
Jeremy Allison
d836024b28 Fixed memory leaks found in enumprinterdrivers code.
Jeremy.
(This used to be commit e08b521559)
2000-09-11 23:43:44 +00:00
Jeremy Allison
588d802877 Fixed up get_a_printer_driver_3 so it looks in the tdb using the correct
key name for a driver info. Version needs to be adjusted in the same
way that it is adjusted when the driver info is stored in the tdb.
AddPrinterConnection() Win32 call caught this one.
Jeremy.
(This used to be commit 54cab7dd3b)
2000-09-08 21:24:45 +00:00
Jeremy Allison
b27571e916 Temporary fix to convert from level6 (Win2k) to level 3 (NT4)
for driver download files.
Jeremy.
(This used to be commit 1c9ac94c94)
2000-09-06 23:20:35 +00:00
David O'Neill
a3a28675fa Changes from APPLIANCE_HEAD (per Tim Potter):
- make proto
	- addition of function to convert from errno values to NT status codes
	  (source/lib/error.c)
	- purge queue done without full access permission will purge only the
	  jobs owned by that user, rather than failing.
	- unlock job database tdb before sending job to printer
	- in print_job_start(), ensure that we don't pick a jobid with an existing
	  temporary file that may be owned by another user, as it causes silent
	  failures.
	- fixes for printer permission checking for NT5 clients
	  (source/include/rpc_spoolss.h, source/printing/nt_printing.c,
	   source/printing/printing.c, source/rpc_server/srv_spoolss_nt.c)
	- change from uint8 to 'enum SID_NAME_USE' (source/rpc_server/srv_lsa.c)
	- fixed memory leaks for win95 driver download process
	  (source/smbd/lanman.c)
	- properly free prs_structs and dacl in testsuite/printing/psec.c
(This used to be commit 74af3e2cae)
2000-09-01 18:49:26 +00:00
Jeremy Allison
fa810d4c80 Implemented DELETEFORM tested using Gerald's Win32 test code :-).
Jeremy.
(This used to be commit 596c21a2af)
2000-08-31 19:04:51 +00:00
Jeremy Allison
c77bf3d9e2 Fixed error returns for moving printer driver files around so generic
"Access denied" isn't always returned. More fixes found using Gerald's
wonderful Win32 test progs :-).
Jeremy.
(This used to be commit 67b9d40e3d)
2000-08-30 21:09:21 +00:00
Jeremy Allison
f03879e0b3 Tidied up some error returns from printing calls. Still need to map UNIX
errors to NT error for print job failure returns. Patch from John Reilly at HP.
Jeremy.
(This used to be commit 3514b5bb8f)
2000-08-23 23:05:49 +00:00
Jeremy Allison
641d9e85ea Added code to do SID to uid/gid conversion. Needed for ACL support.
Jeremy.
(This used to be commit 81c5380f91)
2000-08-23 00:45:40 +00:00