metze/samba/wip.git
15 years agoFix bug 5901: Default for streams_depot location
TAKAHASHI Motonobu [Sun, 16 Nov 2008 12:17:16 +0000 (13:17 +0100)]
Fix bug 5901: Default for streams_depot location

15 years agofix build warning.
Günther Deschner [Tue, 15 Jul 2008 21:05:13 +0000 (23:05 +0200)]
fix build warning.

Guenther
(This used to be commit 507660706901a79544d436046127947e4baa7e52)
(cherry picked from commit 1939177582867fb54a416f3ea979ebd8d4335885)

15 years agoMake memcache_add_talloc NULL out the source pointer
Volker Lendecke [Fri, 14 Nov 2008 12:42:54 +0000 (13:42 +0100)]
Make memcache_add_talloc NULL out the source pointer

This is an orthogonality measure to make clear this pointer now belongs to the
cache.

15 years agoActually finish memcache_add_talloc
Volker Lendecke [Thu, 13 Nov 2008 22:50:19 +0000 (23:50 +0100)]
Actually finish memcache_add_talloc

This fixes a memleak found by Martin Zielinski <mz@seh.de>. Thanks for
looking closely!

Volker

15 years agoUse the correct cups-devel test for HAVE_IPRINT also
Volker Lendecke [Sat, 14 Jun 2008 08:59:11 +0000 (10:59 +0200)]
Use the correct cups-devel test for HAVE_IPRINT also
(cherry picked from commit a42d7e1146e7469062ead2c8f22f549a48154e03)

15 years agoCorrectly check for presence of cups-devel
Volker Lendecke [Sat, 14 Jun 2008 08:31:11 +0000 (10:31 +0200)]
Correctly check for presence of cups-devel

On SuSE at least cups-config belongs to cups-libs which does not contain the
headers which are in cups-devel.
(cherry picked from commit 2408d2493f7c6e0beee58febd547516bbeb0929d)

15 years agowinbind: fix build warning.
Günther Deschner [Fri, 14 Nov 2008 18:49:11 +0000 (19:49 +0100)]
winbind: fix build warning.

Guenther

15 years agomake some more parts of security.idl public and re-run make idl.
Günther Deschner [Fri, 14 Nov 2008 16:53:29 +0000 (17:53 +0100)]
make some more parts of security.idl public and re-run make idl.

Guenther

15 years agore-run make idl.
Günther Deschner [Fri, 14 Nov 2008 15:12:34 +0000 (16:12 +0100)]
re-run make idl.

Guenther
(cherry picked from commit 19568f4e4e94266a7792e6dce8eaa5086f435fc3)

15 years agosecurity.idl: sometimes ACEs have some padding at the end
Stefan Metzmacher [Fri, 7 Nov 2008 09:49:59 +0000 (10:49 +0100)]
security.idl: sometimes ACEs have some padding at the end

metze
(cherry picked from commit 2dc120377baec2c8b7c9b6fe40d15218588c97fd)

15 years agoRename some variables in getpwnam_alloc() for clarity
Volker Lendecke [Fri, 14 Nov 2008 12:13:40 +0000 (13:13 +0100)]
Rename some variables in getpwnam_alloc() for clarity

15 years agosys_pwnam doesn't return talloced memory, so don't mix up the returned struct.
Volker Lendecke [Fri, 14 Nov 2008 11:49:18 +0000 (12:49 +0100)]
sys_pwnam doesn't return talloced memory, so don't mix up the returned struct.

15 years agore-run make idl.
Günther Deschner [Thu, 13 Nov 2008 20:11:12 +0000 (21:11 +0100)]
re-run make idl.

Guenther
(cherry picked from commit 86deff8d6e6b8e094b15a4e5392098d9b23e5ff5)

15 years agoFix PNP_GetHwProfInfo() (fixes Bug: #5888).
Günther Deschner [Thu, 13 Nov 2008 20:11:31 +0000 (21:11 +0100)]
Fix PNP_GetHwProfInfo() (fixes Bug: #5888).

Guenther
(cherry picked from commit 111ec984729fe2c47e173dab82f438bcacf42d1c)

15 years agoMerge branch 'v3-2-test' of ssh://jra@git.samba.org/data/git/samba into samba-3-2...
Jeremy Allison [Thu, 13 Nov 2008 03:28:04 +0000 (19:28 -0800)]
Merge branch 'v3-2-test' of ssh://jra@git.samba.org/data/git/samba into samba-3-2-test

15 years agoPretty print out SD's on get/set.
Jeremy Allison [Thu, 13 Nov 2008 03:26:58 +0000 (19:26 -0800)]
Pretty print out SD's on get/set.
Jeremy.

15 years agoFix memory leak in error path, spotted by Martin Zielinski <mz@seh.de>.
Jeremy Allison [Wed, 12 Nov 2008 22:03:54 +0000 (14:03 -0800)]
Fix memory leak in error path, spotted by Martin Zielinski <mz@seh.de>.
Jeremy.

15 years agoFix bug 5891] : smbd crashed when viewing the eventlog exported by "eventlog list"
Jeremy Allison [Tue, 11 Nov 2008 22:38:36 +0000 (14:38 -0800)]
Fix bug 5891] : smbd crashed when viewing the eventlog exported by "eventlog list"
Don't mix TALLOC and SAFE_FREE().
Jeremy.

15 years agoFix bug 5889. "delete veto files = no" seems to break.
Jeremy Allison [Tue, 11 Nov 2008 22:20:53 +0000 (14:20 -0800)]
Fix bug  5889. "delete veto files = no" seems to break.
Jeremy.

15 years agobuild: prevent make errors for picky makes when $(EXTRA_ALL_TARGETS) is empty
Michael Adam [Mon, 10 Nov 2008 14:01:18 +0000 (15:01 +0100)]
build: prevent make errors for picky makes when $(EXTRA_ALL_TARGETS) is empty

picky make implementations don't like lines with only tabs in rules or dependencie

Michael

15 years agoAdd @CIFSUPCALL_PROGS@ to "all" target so cifs.upcall gets built at
Martin Schwenke [Fri, 7 Nov 2008 01:20:59 +0000 (12:20 +1100)]
Add @CIFSUPCALL_PROGS@ to "all" target so cifs.upcall gets built at
compile time rather than install time.  This stops problems where
packaging scripts pass CFLAGS to "make" but not "make install".

Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Michael Adam <obnox@samba.org>
15 years agontlm_auth: Put huge NTLMv2 blobs into extra_data on CRAP auth
Kai Blin [Fri, 7 Nov 2008 08:50:33 +0000 (09:50 +0100)]
ntlm_auth: Put huge NTLMv2 blobs into extra_data on CRAP auth

This fixes bug #5865

15 years agomount.cifs: use lock/unlock_mtab scheme from util-linux-ng mount prog
Jeff Layton [Thu, 6 Nov 2008 20:15:57 +0000 (15:15 -0500)]
mount.cifs: use lock/unlock_mtab scheme from util-linux-ng mount prog

The util-linux-ng sources have a good, but rather complex scheme for
locking the mtab before updating it. Mount helpers need to follow the
same scheme. Advisory locking only works if everyone is using the same
locking scheme.

Copy the routines we need from util-linux-ng into a separate source file
and then have mount.cifs and umount.cifs link in this object.

The long term goal is to have these routines in a separate helper
library (libmount). Mount helpers can then dynamically link in that lib.
Until that happens, this should serve as a suitable stopgap solution.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
15 years agoFix bug #5825 - Account locking out doesnt work with an LDAP backend.Based on a probl...
Jeremy Allison [Thu, 6 Nov 2008 14:40:35 +0000 (06:40 -0800)]
Fix bug #5825 - Account locking out doesnt work with an LDAP backend.Based on a problem found by Boyang. Only the pdb_nds backend implements login attempts so this was broken for tdbsam and ldap.
Jeremy.

15 years agoAdd reference to bug #4308 to remind me to add regression test to smbtorture.
Jeremy Allison [Thu, 6 Nov 2008 03:11:53 +0000 (19:11 -0800)]
Add reference to bug #4308 to remind me to add regression test to smbtorture.
Jeremy.

15 years agoFixed typo in source/utils/net_rap.c
Joe Smith [Tue, 4 Nov 2008 19:31:04 +0000 (20:31 +0100)]
Fixed typo in source/utils/net_rap.c

15 years agoMerge branch 'v3-2-test' of ssh://jra@git.samba.org/data/git/samba into v3-2-test
Jeremy Allison [Tue, 4 Nov 2008 12:34:30 +0000 (04:34 -0800)]
Merge branch 'v3-2-test' of ssh://jra@git.samba.org/data/git/samba into v3-2-test

15 years agoIgnore 3.0 style invalid group mappings during upgrade to ldb
Volker Lendecke [Tue, 4 Nov 2008 12:33:36 +0000 (04:33 -0800)]
Ignore 3.0 style invalid group mappings during upgrade to ldb

15 years agoFix bug triggered by the RAW-SAMBA3OPLOCKLOGOFF test
Volker Lendecke [Mon, 3 Nov 2008 16:09:40 +0000 (17:09 +0100)]
Fix bug triggered by the RAW-SAMBA3OPLOCKLOGOFF test

15 years agowinbindd: speed up fill_grent_mem (i.e. winbindd_getgrent) a lot.
Michael Adam [Sun, 2 Nov 2008 22:02:02 +0000 (23:02 +0100)]
winbindd: speed up fill_grent_mem (i.e. winbindd_getgrent) a lot.

With large groups, getgrent ran into timeouts because after each
single user that was added to the expanded group list, the list
was sorted and made unique.

Now the list is sorted just once after all members have been added.

Michael

15 years agoFix bug 5860: safe_strcpy gives a nasty error message for overlong strings
Volker Lendecke [Sun, 2 Nov 2008 09:28:00 +0000 (10:28 +0100)]
Fix bug 5860: safe_strcpy gives a nasty error message for overlong strings

Thanks to Robert Dahlem <Robert.Dahlem@gmx.net> for reporting this!

15 years agouse glibc sys/inotify.h header
Andrew Tridgell [Thu, 30 Oct 2008 19:32:06 +0000 (12:32 -0700)]
use glibc sys/inotify.h header

when we first added the inotify code glibc didn't have the inotify
functions yet. Now that it does we can use the official header and
avoid the asm/unistd.h syscall workaround

15 years agoauth: Fix build warning.
Günther Deschner [Mon, 25 Aug 2008 09:36:56 +0000 (11:36 +0200)]
auth: Fix build warning.

Guenther
(cherry picked from commit 4661ef625a6522d6f859b83e3e3702f01d0b952f)
(cherry picked from commit 60649a74cdf2594bc89c301025f86d23caba91c2)

15 years agoFix CID: 456 - resource leak on function exit.
Jeremy Allison [Thu, 30 Oct 2008 00:07:54 +0000 (17:07 -0700)]
Fix CID: 456 - resource leak on function exit.
Jeremy.

15 years agoFix CID 606 - failed to return -1 after socket() fail.
Jeremy Allison [Wed, 29 Oct 2008 23:43:29 +0000 (16:43 -0700)]
Fix CID 606 - failed to return -1 after socket() fail.
Jeremy.

15 years agoFix CID 574 - tidies up the code expression.
Jeremy Allison [Wed, 29 Oct 2008 23:28:04 +0000 (16:28 -0700)]
Fix CID 574 - tidies up the code expression.
Jeremy.

15 years agoCoverity fix CID: 592 - null deref (can't happen but doesn't hurt to be sure).
Jeremy Allison [Wed, 29 Oct 2008 23:02:16 +0000 (16:02 -0700)]
Coverity fix CID: 592 - null deref (can't happen but doesn't hurt to be sure).
Jeremy.

15 years agoCoverity fix #CID: 607 - resource leak on error path.
Jeremy Allison [Wed, 29 Oct 2008 22:54:57 +0000 (15:54 -0700)]
Coverity fix #CID: 607 - resource leak on error path.
Jeremy.

15 years agowinbind: fix smbd hanging on Solaris when winbindd closes socket.
Michael Adam [Mon, 27 Oct 2008 13:28:44 +0000 (14:28 +0100)]
winbind: fix smbd hanging on Solaris when winbindd closes socket.

On some versions of Solaris, we observed a strange effect of close(2)
on a socket: After the server (here winbindd) called close, the client fd
was not marked as readable for select. And a write call to the fd did
not produce an error EPIPE but just returned as if successful.

So while winbindd had called remove_client(), the corresponding smbd
still thought that it was connected, but failed to retrieve answers
for its queries.

This patch works around the problem by forcing the client fd to
the readable state: Just write one byte into the socket before
closing.

Michael

15 years agobuild: fix bug #5765 - fix installlibs on solaris by using portable "test -r"
Michael Adam [Mon, 27 Oct 2008 12:50:27 +0000 (13:50 +0100)]
build: fix bug #5765 - fix installlibs on solaris by using portable "test -r"

instead of test -e, which /bin/sh on solaris does not know.

Michael

15 years agobuild: fix bug #5677 - fix test_{shlibs,nss_modules,pam_modules} on Solaris
Michael Adam [Mon, 27 Oct 2008 11:59:11 +0000 (12:59 +0100)]
build: fix bug #5677 - fix test_{shlibs,nss_modules,pam_modules} on Solaris

and other systems where sh does not support "export FOO=bar"
by separating setting and exporting the variable.

Thanks to Yasuma Takeda <yasuma@osstech.co.jp> for the patch.

Michael

15 years agoError return is boolean false, not -1
Derrell Lipman [Fri, 24 Oct 2008 15:35:10 +0000 (11:35 -0400)]
Error return is boolean false, not -1

- There were a few places in SMBC_getatr() that returned -1 instead of a
  boolean.  -1 was intended to mean error, but that's what False/false is for,
  and the usages of this function assume that it returns a boolean false as
  the error condition.

- per Jelmer's request, use false vs. False in new code, even if not making
  changes globally.

Derrell

15 years agos3-samr-server: unify callback convention: _samr_UserSetInfo.
Günther Deschner [Thu, 23 Oct 2008 01:31:32 +0000 (03:31 +0200)]
s3-samr-server: unify callback convention: _samr_UserSetInfo.

Guenther
(cherry picked from commit aa301e82d0c44c6a733e8be2546d661ea56512ef)

15 years agos3-samr-server: unify callback convention: _samr_QueryDomainInfo.
Günther Deschner [Thu, 23 Oct 2008 01:30:58 +0000 (03:30 +0200)]
s3-samr-server: unify callback convention: _samr_QueryDomainInfo.

Guenther
(cherry picked from commit ac2c35bc379de83091644455dbeba0bea3e5ceb6)

15 years agos3-samr-server: fix return code in _samr_QueryDisplayInformation.
Günther Deschner [Thu, 23 Oct 2008 01:30:14 +0000 (03:30 +0200)]
s3-samr-server: fix return code in _samr_QueryDisplayInformation.

Guenther
(cherry picked from commit 30fa6c3ba19a8f816043405ba5d9eec84dd1c97b)

15 years agoWHATSNEW: Update changes since 3.2.4.
Karolin Seeger [Thu, 23 Oct 2008 10:04:02 +0000 (12:04 +0200)]
WHATSNEW: Update changes since 3.2.4.

Karolin

15 years agos3-samr-server: _samr_DeleteUser needs to wipe out the user_handle on success.
Günther Deschner [Wed, 22 Oct 2008 23:42:27 +0000 (01:42 +0200)]
s3-samr-server: _samr_DeleteUser needs to wipe out the user_handle on success.

Guenther
(cherry picked from commit 8a0054c6d273049bea235803db25912f6cf03610)

15 years agos3-samr-server: fix access check in _samr_QuerySecurity().
Günther Deschner [Wed, 22 Oct 2008 21:16:19 +0000 (23:16 +0200)]
s3-samr-server: fix access check in _samr_QuerySecurity().

Guenther

15 years agoFix net rpc vampire, based on an *amazing* piece of debugging work by "Cooper S....
Jeremy Allison [Wed, 22 Oct 2008 20:18:58 +0000 (13:18 -0700)]
Fix net rpc vampire, based on an *amazing* piece of debugging work by "Cooper S. Blake" <the_analogkid@yahoo.com>.

"I believe I have found two bugs in the 3.2 code and one bug that
carried on to the 3.3 branch.  In the 3.2 code, everything is
located in the utils/net_rpc_samsync.c file.  What I believe is the
first problem is that fetch_database() is calling
samsync_fix_delta_array() with rid_crypt set to true, which means
the password hashes are unencrypted from the RID encryption.
However, I believe this call is redundant, and the corresponding
call for samdump has rid_crypt set to false.  So I think the
rid_crypt param should be false in fetch_database().

If you follow the code, it makes its way to sam_account_from_delta()
where the password hashes are decrypted a second time by calling
sam_pwd_hash().  I believe this is what is scrambling my passwords.

These methods were refactored somewhere in the 3.3 branch.  Now the
net_rpc_samsync.c class calls rpc_vampire_internals, which calls
libnet/libnet_samsync.c, which calls samsync_fix_delta_array() with
rid_crypt always set to false.  I think that's correct.  But the
second bug has carried through in the sam_account_from_delta()
function:

 208         if (memcmp(r->ntpassword.hash, zero_buf, 16) != 0) {
 209                 sam_pwd_hash(r->rid, r->ntpassword.hash, lm_passwd, 0);
 210                 pdb_set_lanman_passwd(account, lm_passwd, PDB_CHANGED);
 211         }
 212
 213         if (memcmp(r->lmpassword.hash, zero_buf, 16) != 0) {
 214                 sam_pwd_hash(r->rid, r->lmpassword.hash, nt_passwd, 0);
 215                 pdb_set_nt_passwd(account, nt_passwd, PDB_CHANGED);

If you look closely you'll see that the nt hash is going into the
lm_passwd variable and the decrypted value is being set in the lanman
hash, and the lanman hash is being decrypted and put into the nt hash
field.  So the LanMan and NT hashes look like they're being put in
the opposite fields."

Fix this by removing the rid_crypt parameter.
Jeremy.

15 years agoFix bug 5840: Segfault in "rpcclient lsaaddacctrights"
Volker Lendecke [Wed, 22 Oct 2008 12:26:05 +0000 (14:26 +0200)]
Fix bug 5840: Segfault in "rpcclient lsaaddacctrights"

15 years agoCope with MAXIMUM_ALLOWED_ACCESS requests when opening handles.
Jeremy Allison [Wed, 22 Oct 2008 00:06:53 +0000 (17:06 -0700)]
Cope with MAXIMUM_ALLOWED_ACCESS requests when opening handles.
Jeremy.

15 years agoMerge branch 'v3-2-test' of ssh://jra@git.samba.org/data/git/samba into v3-2-test
Jeremy Allison [Tue, 21 Oct 2008 19:20:00 +0000 (12:20 -0700)]
Merge branch 'v3-2-test' of ssh://jra@git.samba.org/data/git/samba into v3-2-test

15 years agoDelete the krb5 ccname variable from the PAM environment if set.
Andreas Schneider [Mon, 20 Oct 2008 15:35:42 +0000 (17:35 +0200)]
Delete the krb5 ccname variable from the PAM environment if set.

If winbind sets the KRB5CCNAME variable it should unset it when
the cache gets destroyed.

15 years agoWHATSNEW: Update changes.
Karolin Seeger [Tue, 21 Oct 2008 13:12:57 +0000 (15:12 +0200)]
WHATSNEW: Update changes.

Karolin

15 years agoRemove the requirement for ldap call made as root. Add in security
Jeremy Allison [Mon, 20 Oct 2008 23:53:05 +0000 (16:53 -0700)]
Remove the requirement for ldap call made as root. Add in security
checks for all SAMR calls.
Jeremy.

15 years agos3-samr-server: be consistent when reporting we do password complexity.
Günther Deschner [Mon, 20 Oct 2008 18:16:03 +0000 (20:16 +0200)]
s3-samr-server: be consistent when reporting we do password complexity.

Guenther

15 years agoUnify access checks for lsa server functions.
Jeremy Allison [Fri, 17 Oct 2008 22:25:58 +0000 (15:25 -0700)]
Unify access checks for lsa server functions.
Jeremy.

15 years agoCope with bad trans2mkdir requests from System i QNTC IBM SMB client.
Jeremy Allison [Fri, 17 Oct 2008 04:04:18 +0000 (21:04 -0700)]
Cope with bad trans2mkdir requests from System i QNTC IBM SMB client.
If total_data == 4 Windows doesn't care what values
are placed in that field, it just ignores them.
The System i QNTC IBM SMB client puts bad values here,
so ignore them.
Jeremy.

15 years agoUnify the logic in pull_ascii_base_talloc() and pull_ucs2_base_talloc().
Jeremy Allison [Thu, 16 Oct 2008 22:06:13 +0000 (15:06 -0700)]
Unify the logic in pull_ascii_base_talloc() and pull_ucs2_base_talloc().
Jeremy.

15 years agoFix bug 5826 - Directory/Filenames get truncated when 3.2.0 client acesses old server.
Jeremy Allison [Thu, 16 Oct 2008 18:57:51 +0000 (11:57 -0700)]
Fix bug 5826 - Directory/Filenames get truncated when 3.2.0 client acesses old server.
Karolin this is a show-stopper for 3.2.5.
There was some code in pull_ucs2_base_talloc() to cope with this case which
hadn't been added to pull_ascii_base_talloc(). The older Samba returns non
unicode names which is why you are seeing this codepath being executed.
Jeremy.

15 years agoDon't use debug level 1 to log a trivial message.
Jeremy Allison [Thu, 16 Oct 2008 01:08:07 +0000 (18:08 -0700)]
Don't use debug level 1 to log a trivial message.
Jeremy.

15 years agoWHATSNEW: Update changes since 3.2.4.
Karolin Seeger [Wed, 15 Oct 2008 18:33:59 +0000 (20:33 +0200)]
WHATSNEW: Update changes since 3.2.4.

Karolin

15 years agoWHATSNEW: Update changes since 3.2.4.
Karolin Seeger [Wed, 15 Oct 2008 18:23:24 +0000 (20:23 +0200)]
WHATSNEW: Update changes since 3.2.4.

Karolin

15 years agoAttempt to fix bug #5818 - "smbcacls: sorts ACEs improperly and loses inheritance...
Jeremy Allison [Tue, 14 Oct 2008 23:05:00 +0000 (16:05 -0700)]
Attempt to fix bug #5818 - "smbcacls: sorts ACEs improperly and loses inheritance", based on
a patch from Paul Fertser <fercerpav@gmail.com>. I also added the ability to get/set hex
and symbolic inheritance flag names on ACE flags. I'm still investigating the effects
of setting the "SEC_DESC_DACL_AUTO_INHERIT_REQ" flag as I don't yet see what effects
this is having on the ACE sent.
Jeremy.

15 years agoNote url explaining this code.
Jeremy Allison [Tue, 14 Oct 2008 22:40:44 +0000 (15:40 -0700)]
Note url explaining this code.
Jeremy.

15 years agoFix the "Premature end of data in tag" error when buiding the manpage, fix a typo...
Holger Hetterich [Tue, 14 Oct 2008 18:37:41 +0000 (11:37 -0700)]
Fix the "Premature end of data in tag" error when buiding the manpage, fix a typo in the text, add an example for anonymization usage.

15 years agoUpdate the manpage for vfs_smb_traffic_analyzer to include the anonymize_prefix option
Holger Hetterich [Mon, 13 Oct 2008 21:18:54 +0000 (14:18 -0700)]
Update the manpage for vfs_smb_traffic_analyzer to include the anonymize_prefix option

15 years agoEnable optional anonymization of user names,
Holger Hetterich [Mon, 13 Oct 2008 21:14:25 +0000 (14:14 -0700)]
Enable optional anonymization of user names,
if the configuration parameter anonymization_prefix is defined in
smb.conf, and use the prefix given there.

15 years agoFix bug 5691: SIGBUS on Solaris
Volker Lendecke [Tue, 7 Oct 2008 19:24:25 +0000 (21:24 +0200)]
Fix bug 5691: SIGBUS on Solaris

15 years agoFix the build
Volker Lendecke [Sun, 12 Oct 2008 08:41:29 +0000 (10:41 +0200)]
Fix the build

15 years agoNow it's working, back port the aync fix for parsing large cups printer lists.
Jeremy Allison [Sat, 11 Oct 2008 00:25:44 +0000 (17:25 -0700)]
Now it's working, back port the aync fix for parsing large cups printer lists.
Jeremy.

15 years agoMake use of ZERO_STRUCT (the first memset was actually wrong)
Volker Lendecke [Thu, 9 Oct 2008 15:22:59 +0000 (17:22 +0200)]
Make use of ZERO_STRUCT (the first memset was actually wrong)

15 years agomount.cifs: make return codes match the return codes for /bin/mount (try #3)
Jeff Layton [Thu, 9 Oct 2008 14:44:37 +0000 (10:44 -0400)]
mount.cifs: make return codes match the return codes for /bin/mount (try #3)

The manpage for /bin/mount specifies that the return code should be a
positive integer (actually, it's a bitfield). Clean up the return
codes from mount.cifs to make them match the expected return values
from /bin/mount. This necessary for proper integration with autofs.

This is the third attempt at this patch. The changes here are minor,
just changing some return's from main() into exit() calls for
consistency's sake.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
15 years agomount.cifs: have uppercase_string return success on NULL pointer
Jeff Layton [Thu, 9 Oct 2008 14:42:28 +0000 (10:42 -0400)]
mount.cifs: have uppercase_string return success on NULL pointer

We currently don't attempt to uppercase the device portion of the mount
string if there isn't a prefixpath. Fix that by making uppercase_string
return success without doing anything on a NULL pointer.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
15 years agoFix bug #5814 - Winbindd dumping core in a strange manner while doing "rescan_trusted...
Jeremy Allison [Wed, 8 Oct 2008 18:40:16 +0000 (11:40 -0700)]
Fix bug #5814 - Winbindd dumping core in a strange manner while doing "rescan_trusted_domain".
From analysis by hargagan <shargagan@novell.com> :
"The winbindd_child_died() is also getting called from process_loop() in case of
SIGCHLD signal. In this case it doesn't make the timeout_handler to NULL for
the first request. It then initiate a new request using
schedule_async_request() which installs a new timeout handler for the same
request. In such a case, for a badly unresponsive system both the timeout
handler can be called. For the first call the "private_data" will be cleared
and for another call the timeout handler will be detecting the double free. So,
for such a case as well, the winbindd_child_died() should make the
timeout_handler to NULL."
Jeremy.

15 years agoFixed build warning "passing arg from incompatible pointer type"
Tim Prouty [Tue, 7 Oct 2008 17:30:22 +0000 (10:30 -0700)]
Fixed build warning "passing arg from incompatible pointer type"

The fix explicitly makes the conversion from timeval to time_t using the
existing time utility functions.

Compiling modules/vfs_smb_traffic_analyzer.c
modules/vfs_smb_traffic_analyzer.c: In function `smb_traffic_analyzer_send_data':
modules/vfs_smb_traffic_analyzer.c:173: warning: passing arg 1 of `localtime' from incompatible pointer type

15 years agoFixed "declaration shadows global declaration" warnings.
Tim Prouty [Tue, 7 Oct 2008 17:13:51 +0000 (10:13 -0700)]
Fixed "declaration shadows global declaration" warnings.

The patch simply uses a more descriptive variable name for tcp_seq.

lib/socket_wrapper/socket_wrapper.c:753: warning: declaration of 'tcp_seq' shadows a global declaration
/usr/include/netinet/tcp.h:40: warning: shadowed declaration is here
lib/socket_wrapper/socket_wrapper.c: In function `swrap_marshall_packet':
lib/socket_wrapper/socket_wrapper.c:919: warning: declaration of 'tcp_seq' shadows a global declaration
/usr/include/netinet/tcp.h:40: warning: shadowed declaration is here

15 years agoIf name_to_fqdn fails, retry with the dns domain the DC gave us
Volker Lendecke [Mon, 6 Oct 2008 21:10:23 +0000 (14:10 -0700)]
If name_to_fqdn fails, retry with the dns domain the DC gave us

This is a workaround for the cases where you want to join under a netbios name
that is different from your hostname, i.e. a name that can not be found in
/etc/hosts or dns. In these cases, name_to_fqdn fails or gives invalid results.

15 years agoLog in the parent winbind log where a request is going
Volker Lendecke [Mon, 6 Oct 2008 21:10:10 +0000 (14:10 -0700)]
Log in the parent winbind log where a request is going

15 years agoRemove an unused variable
Volker Lendecke [Sun, 5 Oct 2008 21:34:58 +0000 (14:34 -0700)]
Remove an unused variable

15 years agoFix some missing error handlings
Volker Lendecke [Sun, 5 Oct 2008 21:34:01 +0000 (14:34 -0700)]
Fix some missing error handlings

15 years agoOS/X does not have rl_done in readline.h
Volker Lendecke [Sun, 5 Oct 2008 21:29:50 +0000 (14:29 -0700)]
OS/X does not have rl_done in readline.h

15 years agoFix an uninitialized variable warning
Volker Lendecke [Sun, 5 Oct 2008 21:28:33 +0000 (14:28 -0700)]
Fix an uninitialized variable warning

Not sure if we can ever not get domain and dns_domain, but gcc complained

15 years agoFix an unlikely memleak found by the IBM checker
Volker Lendecke [Sun, 5 Oct 2008 02:39:39 +0000 (19:39 -0700)]
Fix an unlikely memleak found by the IBM checker

15 years agoFix an uninitialized variable found by the IBM Checker
Volker Lendecke [Sun, 5 Oct 2008 02:38:42 +0000 (19:38 -0700)]
Fix an uninitialized variable found by the IBM Checker

15 years agoFix a potential NULL deref in line 258 found by the IBM checker
Volker Lendecke [Sun, 5 Oct 2008 02:38:04 +0000 (19:38 -0700)]
Fix a potential NULL deref in line 258 found by the IBM checker

15 years agoCorrectly fix smbclient to terminate on eof from server.
Jeremy Allison [Fri, 3 Oct 2008 21:56:30 +0000 (14:56 -0700)]
Correctly fix smbclient to terminate on eof from server.
Jeremy.

15 years agonet_dns: Make "lwinet ads dns register" honor the "interfaces" parameter.
Gerald (Jerry) Carter [Fri, 3 Oct 2008 15:51:54 +0000 (10:51 -0500)]
net_dns: Make "lwinet ads dns register" honor the "interfaces" parameter.

This is helpful on multihomed hosts that only require a subset
of IP addresses be registered with DNS.
(cherry picked from commit 17c9f8810598d8117befc896d12a597a52b0ac3b)

15 years agolibaddns: Use the same prerequisite for DDNS update as Windows XP.
Gerald (Jerry) Carter [Fri, 3 Oct 2008 15:51:21 +0000 (10:51 -0500)]
libaddns: Use the same prerequisite for DDNS update as Windows XP.

   Hostname, TYPE: CNAME, CLASS: NONE

This has to have been broken for ages.  I cannot see
how it would have worked in any environment.
(cherry picked from commit 6b6402bce318a48b0890ed6fc23ed5b30440927b)

15 years agoFix bug #5080. Access to cups-printers via samba broken with cups 1.3.4, Unsupported...
Jeremy Allison [Thu, 2 Oct 2008 21:02:20 +0000 (14:02 -0700)]
Fix bug #5080. Access to cups-printers via samba broken with cups 1.3.4, Unsupported character set.
Cups 1.3.4 expects utf8 to be used in all messages to/from the server. We may be using a
different character set so we need to use talloc utf8 push/pull functions in all communication.
Contains the !server fix already applied to 3.3.
Jeremy.

15 years agoFix bug 5805: don't close stdout
Derrell Lipman [Thu, 2 Oct 2008 13:17:49 +0000 (09:17 -0400)]
Fix bug 5805: don't close stdout

- When calling setup_logging multiple times, the code was closing the debug
  file descriptor before opening or assigning the new one.  We don't, however,
  want to close the debug file descriptor if it is stdout.

Derrell

15 years agoWhitespace cleanup.
Jeremy Allison [Wed, 1 Oct 2008 22:00:35 +0000 (15:00 -0700)]
Whitespace cleanup.
Jeremy.

15 years agoFix use of DLIST_REMOVE as spotted by Constantine Vetoshev <gepardcv@gmail.com>.
Jeremy Allison [Wed, 1 Oct 2008 20:22:02 +0000 (13:22 -0700)]
Fix use of DLIST_REMOVE as spotted by Constantine Vetoshev <gepardcv@gmail.com>.
This API is unusual in that if used to remove a non-list head it nulls out
the next and prev pointers. This is what you want for debugging (don't want
an entry removed from the list to be still virtually linked into it) but
means there is no consistent idiom for use as the next and prev pointers
get trashed on removal from the list, meaning you must save them yourself.
You can use it one way when deleting everything via the head pointer, as
this preserves the next pointer, but you *must* use it another way when not
deleting everything via the head pointer. Fix all known uses of this (the main
one is in conn_free_internal() and would not free all the private data entries
for vfs modules. The other changes in web/statuspage.c and winbindd_util.c
are not strictly neccessary, as the head pointer is being used, but I've done
them for consistency. Long term we must revisit this as this API is too hard
to use correctly.
Jeremy.

15 years agoTurn the socket connections into a refcounted list - in the common case there'll...
Jeremy Allison [Wed, 1 Oct 2008 19:30:12 +0000 (12:30 -0700)]
Turn the socket connections into a refcounted list - in the common case there'll now only be one socket per smbd.
Changed the format of the wire data to (a) include a version number (V1) as the first element. (b) removed the
";)" at the end an replaced it with a "\n". Receiver can change back if needed, and now receiver can just log
"as-is" to a text file (making testing easier). Added my (C). Sorry Holger, but I've changed quite a bit now.
Jeremy.

15 years agoConvert to allocated strings. Use write_data(), not send as this doesn't correctly
Jeremy Allison [Tue, 30 Sep 2008 23:20:29 +0000 (16:20 -0700)]
Convert to allocated strings. Use write_data(), not send as this doesn't correctly
deal with EINTR. Jim and Holger please check this still works.
Jeremy.

15 years agoRestructure the module so it connects to the remote data sink
Jeremy Allison [Tue, 30 Sep 2008 22:09:49 +0000 (15:09 -0700)]
Restructure the module so it connects to the remote data sink
on connect, and closes the socket on client disconnect. This should
make it much more efficient. Store the remote fd in a private data
pointer off the handle. Finally we need to remove the fstrings and
convert to allocated buffer storage.
Jeremy.

15 years agoFix the make test problem Karolin reported. Now rename_open_files actually works...
Jeremy Allison [Tue, 30 Sep 2008 20:21:27 +0000 (13:21 -0700)]
Fix the make test problem Karolin reported. Now rename_open_files actually works correctly we must emit the change notify before we change the name, not before.
Jeremy.

15 years agore-added "winbind:ignore domains" patch
Andrew Tridgell [Mon, 29 Sep 2008 23:04:23 +0000 (16:04 -0700)]
re-added "winbind:ignore domains" patch

This option really is essential, as we discover again and again at
customer sites. Due to bugs in winbind some domains are toxic. When
you are installing at a site and a particular domain in a complex
setup causes winbind to segfault or hang then you need a way to
disable that domain and continue.

In an ideal world winbind could handle arbitrarily complex ADS
domains, but we are nowhere near that yet. If we ever get to that
stage then we won't need this option.

15 years agofixed segv on startup with trusted domains
Andrew Tridgell [Mon, 29 Sep 2008 18:24:00 +0000 (11:24 -0700)]
fixed segv on startup with trusted domains

With some setups, idmap_tdb2_allocate_id can be called before the
allocate backend is initialised, leading to a segv. This change
ensures that the db is opened in all paths that use it

15 years agoEnsure we null out fsp after a close in all paths.
Jeremy Allison [Mon, 29 Sep 2008 17:57:32 +0000 (10:57 -0700)]
Ensure we null out fsp after a close in all paths.
Jeremy.