1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

29104 Commits

Author SHA1 Message Date
Volker Lendecke
ab5b1431a0 Gna, how long do I program in C now??? :-) 2009-05-27 08:10:28 +02:00
Volker Lendecke
3ada1a19ab Attempt to fix the build on HP/UX 2009-05-26 23:38:22 +02:00
Volker Lendecke
dd0506d15d Attempt to fix the build on NetBSD 2009-05-26 23:20:34 +02:00
Björn Jacke
4db54fff13 Revert "s3: fix build on systems with struct stat member st_flags"
for a cleaner and more complete patch that Volker has in the queue :-)
2009-05-26 23:19:00 +02:00
Björn Jacke
93e16a08d4 s3: fix build on systems with struct stat member st_flags 2009-05-26 22:41:45 +02:00
Volker Lendecke
447515efaa Fix some nonempty blank lines 2009-05-26 21:07:44 +02:00
Volker Lendecke
49ca690b4b Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STAT
This patch introduces

struct stat_ex {
        dev_t           st_ex_dev;
        ino_t           st_ex_ino;
        mode_t          st_ex_mode;
        nlink_t         st_ex_nlink;
        uid_t           st_ex_uid;
        gid_t           st_ex_gid;
        dev_t           st_ex_rdev;
        off_t           st_ex_size;
        struct timespec st_ex_atime;
        struct timespec st_ex_mtime;
        struct timespec st_ex_ctime;
        struct timespec st_ex_btime; /* birthtime */
        blksize_t       st_ex_blksize;
        blkcnt_t        st_ex_blocks;
};
typedef struct stat_ex SMB_STRUCT_STAT;

It is really large because due to the friendly libc headers playing macro
tricks with fields like st_ino, so I renamed them to st_ex_xxx.

Why this change? To support birthtime, we already have quite a few #ifdef's at
places where it does not really belong. With a stat struct that we control, we
can consolidate the nanosecond timestamps and the birthtime deep in the VFS
stat calls.

At this moment it is triggered by a request to support the birthtime field for
GPFS. GPFS does not extend the system level struct stat, but instead has a
separate call that gets us the additional information beyond posix. Without
being able to do that within the VFS stat calls, that support would have to be
scattered around the main smbd code.

It will very likely break all the onefs modules, but I think the changes will
be reasonably easy to do.
2009-05-26 17:48:23 +02:00
Stefan Metzmacher
52f2f9449f s3:smbd: remove unused global 'orig_inbuf'
metze
2009-05-26 16:36:25 +02:00
Björn Jacke
caeae66c5b s3:pam_smbpass: don't call openlog() or closelog() from pam_smbpass
Patch from Steve Langasek with tiny fixes by me to make it apply to master.
Also see Debian bug #434372 and bugzilla #4831.

Calling openlog() or closelog() inside a pam module is not good as these
functions are not stackable and no program won't re-do openlog() just because a
pam module might have called closelog().
2009-05-26 16:23:11 +02:00
Stefan Metzmacher
ebc860ebeb s3:smbd: move SMB1 specific stuff into a substructure of smbd_server_connection
metze
2009-05-26 10:48:12 +02:00
Stefan Metzmacher
31c6679bf1 s3:smbd: add support for SMB2 signing
metze
2009-05-26 09:53:06 +02:00
Stefan Metzmacher
bd8a38b60e s3:smbd: return the correct security mode and capabilities in SMB2 Negotitate
metze
2009-05-26 09:53:05 +02:00
Michael Adam
714acfac01 s3:dbwrap_tool: add listkeys operation
Michael
2009-05-26 00:51:41 +02:00
Michael Adam
11f0759900 s3:dbwrap_tool: remove superfluous command mapping
Michael
2009-05-26 00:51:40 +02:00
Michael Adam
dfe06d21bd s3:dbwrap_tool: add "erase" opearation
Michael
2009-05-26 00:51:40 +02:00
Kai Blin
fb262f79fa net: Use samba default command line arguments.
Attention:

The meaning of the -N flag changed.
To get the old meaning for net groupmap set, use the long option --ntname
The long option for using kerberos changed from --kerberos to --use-kerberos

net rpc commands will now prompt for a password if none is given.

As a benefit, net will now accept an authentication file like other samba
command line tools. So no need to specify the password on the command line in
scripts anymore.

This should fix bug #6357

Signed-off-by: Kai Blin <kai@samba.org>
2009-05-25 23:35:38 +02:00
Kai Blin
a98ba0cbe9 s3 ctags: ignore all proto.h files for tag generation 2009-05-25 23:35:37 +02:00
Michael Adam
3a853448ce s3:winbind_util: remove trailing spaces
Michael
2009-05-25 22:16:47 +02:00
Michael Adam
f5a5c6a5dc s3:dbwrap_ctdb: fix some function header comments
Michael
2009-05-25 22:16:46 +02:00
Slava Semushin
326237c4dd source3/utils/log2pcaphex.c(main): fixed file descriptors leak.
One of leaks found by cppcheck:
[./source3/utils/log2pcaphex.c:367]: (error) Resource leak: out
2009-05-25 16:25:57 +02:00
Slava Semushin
5d2cd81645 source{3,4}/torture/smbiconv.c(main): fixed file descriptor leak.
File descriptor leaks only when we use file instead of stdout.

Found by cppcheck:
[./source3/torture/smbiconv.c:219]: (error) Resource leak: out
[./source4/torture/smbiconv.c:211]: (error) Resource leak: out
2009-05-25 16:18:48 +02:00
Günther Deschner
4258750e4f s3-selftest: fix typo.
Guenther
2009-05-25 15:56:47 +02:00
Michael Adam
3111d78001 s3:winbind:idmap_ldap: warn about duplicate SID->XID mappings (bug #6387)
With the current infrastructure, we should not return error on
duplicate mappings but just warn instead (because an error would
trigger the attempt to create yet another mapping).

Michael
2009-05-25 14:57:06 +02:00
Michael Adam
35c3f4162d s3:winbind:idmap_ldap: warn about duplicate XID->SID mappings (bug #6387)
With the current infrastructure, we should not return error on
duplicate mappings but just warn instead (because an error would
trigger the attempt to create yet another mapping).

Michael
2009-05-25 14:57:06 +02:00
Günther Deschner
fca7dce1a9 s3-samr: Fix Bug #6372, usermanager only displaying 1024 groups and aliases.
This is now also verified with the RPC-SAMR-LARGE-DC test.

Guenther
2009-05-25 14:05:18 +02:00
Günther Deschner
f0139e3b69 s3-selftest: enable RPC-SAMR-LARGE-DC against Samba3.
This will fail for alias creation as nss_wrapper does not yet wrap around
libnss_winbind.

Guenther
2009-05-25 14:03:16 +02:00
Günther Deschner
1950e180ca s3-pamsmbpass: copy _pam_get_item and _pam_get_data from pam_winbind.
Guenther
2009-05-25 13:52:50 +02:00
Günther Deschner
86d087fccc s3-rpcclient: use get_domain_handle() fn in enum domain users & groups.
Guenther
2009-05-25 13:52:50 +02:00
Volker Lendecke
2d689ad9fc Attempt to fix a debian build problem 2009-05-25 12:43:22 +02:00
Volker Lendecke
5302db6326 TALLOC_FREE happily lives with a NULL ptr. Tim, please check!
Thanks,

Volker
2009-05-24 22:13:07 +02:00
Volker Lendecke
68c5c6df0e Fix a race condition in winbind leading to a panic
In winbind, we do multiple events in one select round. This needs fixing, but
as long as we're still using it, for efficiency reasons we need to do that.

What can happen is the following: We have outgoing data pending for a client,
thus

	state->fd_event.flags == EVENT_FD_WRITE

Now a new client comes in, we go through the list of clients to find an idle
one. The detection for idle clients in remove_idle_client does not take the
pending data into account. We close the socket that has pending outgoing data,
the accept(2) one syscall later gives us the same socket.

In new_connection(), we do a setup_async_read, setting up a read fde. The
select from before however had found the socket (that we had already closed!!)
to be writable. In rw_callback we only want to see a readable flag, and we
panic in the SMB_ASSERT(flags == EVENT_FD_READ).

Found using

bin/smbtorture //127.0.0.1/tmp -U% -N 500 -o 2 local-wbclient

Volker
2009-05-24 18:57:13 +02:00
Volker Lendecke
e744b0af68 use epoll for local-wbclient test 2009-05-24 13:51:32 +02:00
Volker Lendecke
7043ef2a79 Don't limit the number of retries in wb_trans.
This is better done with a tevent_req_set_endtime the caller should issue.
2009-05-24 13:51:07 +02:00
Volker Lendecke
f528dbcf2e Don't set a timeout deep inside wb_connect 2009-05-24 13:51:01 +02:00
Volker Lendecke
4906d7fc67 Do queueing in wbclient.c
The _trigger fn must know about wbc_context, while we were waiting in the
queue the fd might have changed
2009-05-24 13:50:43 +02:00
Volker Lendecke
e337124c55 Fix closed_fd(): select returning 0 means no fd listening 2009-05-24 13:50:35 +02:00
Volker Lendecke
6492ffd8df Fix wb_simple_trans queueing 2009-05-24 13:49:59 +02:00
Volker Lendecke
a8e02b591b Add "err_on_readability" to writev_send
A socket where the other side has closed only becomes readable. To catch
errors early when sitting in a pure writev, we need to also test for
readability.
2009-05-24 13:47:29 +02:00
Jeremy Allison
8c39931eb3 Ensure we return NT_STATUS_FILE_IS_A_DIRECTORY on a posix open on a
directory name.
Jeremy.
2009-05-22 15:55:27 -07:00
Jeremy Allison
e3851a9110 Test that POSIX open of a directory returns NT_STATUS_FILE_IS_A_DIRECTORY (ERRDOS, EISDIR).
Jeremy.
2009-05-22 15:21:55 -07:00
Stefan Metzmacher
202509a347 s3:smbd: implement SMB2 Tree Disconnect
metze
2009-05-22 14:03:14 +02:00
Stefan Metzmacher
7dfbb2835f s3:smbd: implement SMB2 Tree Connect
For now this only checks if the share is present or not.

metze
2009-05-22 14:03:13 +02:00
Stefan Metzmacher
7749647740 s3:smbd: SMB2 session ids are 64bit...
We only grand ids up to 0x0000000000FFFFFF,
because that's what our idtree implementation can handle.
But also 16777215 sessions on one tcp connection should be enough:-)

metze
2009-05-22 14:03:13 +02:00
Michael Adam
e9010fa366 s3:winbind:idmap_ldap: fix a crash bug in idmap_ldap_unixids_to_sids (#6387)
This fixes a crash bug hit when multiple mappings were found by
the ldap search. This crash was caused by an ldap asssertion
in ldap_next_entry because was set to NULL in each iteration.

The corresponding fix was applied to the idmap_ldap_sids_to_unixids()
by Jerry in 2007 (b066668b74768d9ed547f16bf7b6ba6aea5df20a).

This fixes the crash part of bug #6387.

There is a logic part, too:
The problem currently only occurs when multiple mappings are found
for one given unixid. Now winbindd does not crash any more but
it does not correctly handle this situation. It just returns the
last mapping from the ldap search results.
This needs fixing.

Michael
2009-05-22 12:06:59 +02:00
Stefan Metzmacher
1f59788516 s3:smbd: implement SMB2 Logoff
metze
2009-05-22 10:28:37 +02:00
Jeremy Allison
53de3b136e Don't steal when we know the ptr will be null. Thanks to Simo for
pointing this out.
Jeremy.
2009-05-21 18:48:17 -07:00
Jeremy Allison
5dd82fb675 Revert the last two commits (fix for #6386). The actual problem
was a bug in ldb in 3.2 which could return a freed pointer on
ret != LDAP_SUCCESS. The main thing we must ensure is that we
never talloc_steal until we know LDAP_SUCCESS was returned.
Jeremy.
2009-05-21 18:37:36 -07:00
Jeremy Allison
87504b27d8 Ensure all possible uses of indirection through res are checked after
an ldb_search.
Jeremy.
2009-05-21 18:00:54 -07:00
Jeremy Allison
d4d06a4ef9 Attempt to fix bug #6386 - Samba Panic triggered by Sophos Control Centre.
Don't indirect a potentially null pointer.
Jeremy.
2009-05-21 17:27:25 -07:00
Tim Prouty
96ede10cfb s3 torture: Fix warning 2009-05-21 12:17:53 -07:00