1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-15 05:57:49 +03:00

22 Commits

Author SHA1 Message Date
Jeremy Allison
4143aa83c0 r17294: Make the code a little cleaner. Instead of using the two
calls make it :

become_root_uid_only()
operation
unbecome_root_uid_only()

saving errno across the second call. Most of our internal
change calls can be replaced with these simple calls.

Jeremy
2007-10-10 11:38:24 -05:00
Jeremy Allison
4ace291278 r17293: After the results from the cluster tests in Germany,
fix the messaging code to call the efficient calls :

save_re_uid()
set_effective_uid(0);

messaging_op

restore_re_uid();

instead of using heavyweight become_root()/unbecome_root()
pairs around all messaging code. Fixup the messaging
code to ensure sec_init() is called (only once) so that non-root
processes still work when sending messages.

This is a lighter weight solution to become_root()/unbecome_root()
(which swaps all the supplemental groups) and should be more
efficient. I will migrate all server code over to using this
(a similar technique should be used in the passdb backend
where needed).

Jeremy.
2007-10-10 11:38:24 -05:00
Andrew Bartlett
ca24ae50ea Clarify comment on set_effective_uid()
Andrew Bartlett
-
Volker Lendecke
556c62f935 After a phonecall with jra finally commit this.
This changes our behaviour when the setresuid call is available. We now not
only change the effective uid but also the real uid when becoming
unprivileged. This is mainly for improved AFS compatibility, as AFS selects
the token to send to the server based on the real uid of the process.

I tested this with a W2k server with two non-root 'runas' sessions. They come
in via a single smbd as two different users using two session setups. Samba on
Linux can still switch between the two uids, proved by two different files
created via those sessions.

Volker
-
Volker Lendecke
1fed55aa78 Add a descriptive comment to our usage of setresuid. lib/afs.c needs
to be changed if we decide to set our real uid. Jeremy?

Volker
-
Andrew Tridgell
03ac082dcb updated the 3.0 branch from the head branch - ready for alpha18 -
Tim Potter
a5ac2ac4ad Spelling fixes. -
Andrew Tridgell
569505b771 reverted tims patch that broke configure
why does anything but smbd care about sec_init() anyway??
-
Tim Potter
e7abb79fb3 Whoops, typo. -
Tim Potter
1b941e2c63 Do a smb_panic() if sec_initial_[ug]id() or non_root_mode() is called
without before sec_init().  This should avoid the formation of another
magic function club.  (-:
-
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
Andrew Bartlett
0c8e9339d8 Parionia to ensure people don't install libsmb based programs setuid root.
libsmb has not been written to be setuid, with things like LIBSMB_PROG allowing
all sort of fun and games.

Andrew Bartlett
-
Tim Potter
2d0922b0ea Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. -
Andrew Bartlett
bc1385fc5e Restore the profiling data shmem parinoia. This whole area needs to be
fixed - an mmaped file or the like would be a good idea.
-
Andrew Tridgell
9449544428 added sec_initial_uid() function so we can ask if a file is owned by
the initial uid
-
Andrew Tridgell
9a9da44455 fixed inetd operation as non-root -
Andrew Tridgell
72f63f5144 make sure we have BOOL in autoconf usage of util_sec.c -
Andrew Tridgell
55109a7525 - make the regresison test mode code build in by default. This should
allow us to have test targets without special configure options
- fixed make proto so that it actually does something
-
Andrew Tridgell
7e8e6ae9a8 added the ability to test smbd safely as an ordinary user. The way it works is
that libsmb/ creates a local tcp socket then launches smbd as a subprocess
attached to that socket. smbd thinks it is being launched from inetd.

to use it do the following:

- compile with -DSMB_REGRESSION_TEST
- run like this (also works with smbtorture etc)
    export SMBD_TEST=1
    export LIBSMB_PROG=bin/smbd
    smbclient //server/share -Uuser%pass

obviously you need to setup a smb.conf etc. Using --prefix to configure
is useful.

The aim of all this stuff is to add a decent set of regression tests
to the build farm, so we know if smbd actually runs correctly on all the
platforms, not just builds. We can run smbtorture, masktest, locktest etc,
plus a bunch of smbclient scripts and any new tests we write.

This doesn't help much with nmbd (at least not yet) but its a good start.
-
Tim Potter
6553f1d027 Fixed compiler warning. -
Jeremy Allison
ebcdb4afee Moved over lib/util_sec (with added fixes) as the HEAD source
seems to have drifted a little.
Jeremy.
-
Andrew Tridgell
955d187139 util_sec.c from 2.0.6 -