1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

2027 Commits

Author SHA1 Message Date
Luke Leighton
ba0cdbe8f5 first attempt at making unix setuid/setgid code that is independent of
cnums and snums.
(This used to be commit 657f46edfbea852309505f5e3065506127eda6a2)
1998-12-07 20:28:51 +00:00
Luke Leighton
9c848ec329 removed nt_pipe_fnum from struct cli_state. need to be able to call
LsaLookupSids etc from within SamrQueryAliasMembers, for example.
fnum is now a parameter to client functions.  thanks to mike black
for starting the ball rolling.
(This used to be commit bee8f7fa6b0f7f995f71303f4e14a4aaed0c2437)
1998-12-07 20:23:41 +00:00
Luke Leighton
312f4f3960 - lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
	change module that is independent of "cnums" and "snums".
	a security context is needed for pipes, not just IPC$ or other
	services.

- group database API

	added add_group/alias_member, del_group/alias_member,
	del_group/alias_entry functions.  del_builtin_entry() is
	deliberately set to NULL to cause an exception, you cannot
	delete builtin aliases.

- parse_lsa.c srv_lsa.c

	fixed lookup_names code, it was a load of trash and didn't do
	anything.

- cmd_samr.c rpcclient.c srv_samr.c

	added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
	"addgroupmem", "addaliasmem", "createalias", "creategroup", to
	both client and server code.

	server code calls into unix stubs right now, which don't actually
	do anything.  the only instance where they are expected to do
	anything is in appliance mode NOT even in the ldap code or anything.

	client code modified to call samr_lookup_names() for group code
	(because we can) and lsa_lookup_names() for alias code (because
	we have to).

- srv_lookup.c

	oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
	instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 17:23:48 +00:00
Andrew Tridgell
637414904d oops - lock test was the wrong way around
(This used to be commit 783d4b3477fa9e363aa1f7524bd060019648ab0d)
1998-12-05 08:19:42 +00:00
Andrew Tridgell
84ba7b422d fixed pidfile handling to check for a lock on the file, so we can be
sure it is a samba process that is running.
(This used to be commit f7ad78e369ebf2f4d31e8259e3e1fdd4c087b037)
1998-12-05 08:09:59 +00:00
Jeremy Allison
8554959985 Sync up critical kernel oplock bugfix. I don't want to lose
this....
Jeremy.
(This used to be commit 5287f3d19b7d8e76970f1ce1abfd95b7341434e5)
1998-12-05 01:03:42 +00:00
Luke Leighton
7cbd3bcef5 added delete domain group and local group and delete domain group member.
(This used to be commit bf15343def5b95ce4387ac4357674aff31431194)
1998-12-04 23:06:27 +00:00
Luke Leighton
8891f8c6b9 fixing "addgroupmem" and "enumgroups -m" commands, samr_open_group()
needed a flags fields as you get 0x0000 0010 and 0x0000 001f unknown
values for different purposes, no-one's going to tell us what they
are and i don't CARE!
(This used to be commit aabb4b3bc5119ef317b5697ae6fcf5d36c2d474e)
1998-12-04 22:00:39 +00:00
Luke Leighton
89c56492a8 - oops, i got "add alias member" and "delete alias member" swapped.
- samr_enum_dom_users, the first 4 bytes is some sort of garbage,
  nt5-beta2 clears them out to zeros whereas nt4 does not.
  fixed bug where we were assuming that the first 4 bytes of a
  response _had_ to be non-zero.

- cli_lsarpc.c: forgot to append the rid on the lsa_lookup_names()
  client call.

- added in "addaliasmem" and "addgroupmem" commands.  the addaliasmem
  command actually turned out to be a "delaliasmem" :-) :-)

- parse_lsa.c: moved assert array check to after the size of useable
  array space is set...
(This used to be commit 165b15a8cacc4bc7cf8cc0b9aaabb6b92cef7fdb)
1998-12-04 21:48:06 +00:00
Luke Leighton
cf0ea874b1 - renamed do_samr_xxx to samr_xxx
- renamed do_lsa_xxx to lsa_xxx

- added "enumgroups [-m]" command, enumerates groups, shows members.
- added cmd_sam_add_groupmem(), need to call these in rpcclient.c
- added cmd_sam_add_aliasmem(), need to call these in rpcclient.c

- modified "enumaliases [-m]" command

- improved "enumgroups" and "enumaliases" to display names not just RIDS/SIDs.

- renamed "samr_unknown_12" to "samr_lookup_rids".

- added the following client-side functions:

	get_samr_query_groupmem()
	get_samr_query_aliasmem()
	get_samr_query_groupinfo()
	samr_enum_dom_groups()
	samr_enum_dom_aliases()
	samr_add_aliasmem()
	samr_add_groupmem()

- improved display output (display.c)
(This used to be commit eacc5e581af2b4de24186b9be3238b352c54effe)
1998-12-04 16:30:00 +00:00
Luke Leighton
32167eda0d added createalias command to rpcclient
(This used to be commit 4771d5451b49375cc2fd4246d7d746b0d03cd5ba)
1998-12-03 22:20:30 +00:00
Luke Leighton
b99dc808df create domain group command (creategroup) added to rpcclient.
renamed do_samr_xxxx to samr_xxxx.
(This used to be commit 1e5d81c154740349a2cda4c1892b33a21c0683a8)
1998-12-03 20:50:33 +00:00
Luke Leighton
f3787515d6 moved get_unixgroups it will be needed by the unix instance of the group
DB API
(This used to be commit ef58e48bc9af338ed6c734205d4faf82371284ac)
1998-12-03 17:41:14 +00:00
Luke Leighton
8d08fb7323 jean-f spotted race condition on generation of sam sid, from starting
nmbd and smbd.  nmbd is now client: smbd is solely responsible for
creating sam_name.SID
(This used to be commit 50fa4822df679b4d54b5a868179594ec087e811f)
1998-12-03 17:38:20 +00:00
Luke Leighton
04452b0975 jean-f spotted bug in test for existence of MACHINE.SID and SAM_NAME.SID.
(This used to be commit 81be1e60764d380adf47737552659854d94ca626)
1998-12-03 17:34:05 +00:00
Luke Leighton
404b7b49b2 adding group parsing: add/modify/delete/add members.
(This used to be commit 13a656b0e5c73e157b222765fb57a1bdafc67b80)
1998-12-03 17:29:03 +00:00
Luke Leighton
6429d682f9 jeremy's going to do me in, again.
jean-francois' going to get annoyed, again.
andrew's going to threaten to take cvs access away, again.

missed compilation of this file when updating sam_unknown_12 call.
(This used to be commit 74f826af36a7af4e91f9325d11ef8432d343c3bd)
1998-12-02 22:48:00 +00:00
Luke Leighton
364025fe37 spotted the mistake in group_info1 parsing.
(This used to be commit e39c0c76ae52bbd4539f8f254e78566a5511efc1)
1998-12-02 22:13:48 +00:00
Luke Leighton
78df0fb8f1 added rid and sid_name_use to DOMAIN_GRP_MEMBER, for use in group member
query.

domain groups now work, hurrah!  only thing is that the description is
one character long, don't know why (which is wierd in itself).
(This used to be commit 78a86c64960a7823b0db8b7bebfffabb4a5ba864)
1998-12-02 22:05:56 +00:00
Luke Leighton
90ce7b9288 ERRmoredata is an acceptable error code, it is not an error.
(This used to be commit 9bce7340d60a49594f67cc3c6cc6119b33a5358a)
1998-12-02 20:03:08 +00:00
Luke Leighton
7c55f66f4c removed check on name of domain having to be right, etc etc.
(This used to be commit a74b6dcc76794c1fe350d6906f156fdf5189e18b)
1998-12-02 16:27:38 +00:00
Luke Leighton
6c94b455a0 trailing backslashes spotted by andrej.
(This used to be commit 9266137fcb87b6e4b2cc45a55341ebaa69c594b7)
1998-12-02 16:21:25 +00:00
Luke Leighton
1bf14231e1 issues spotted by andrej: %s\\%s not %s\%s
(This used to be commit 779a7aa30d4b8a3c8ca1d817a3fd9886c0437def)
1998-12-02 16:20:36 +00:00
Luke Leighton
137f9c7042 string_to_sid was using next_token() this is bad as it stops you from
being able to use next_token() outside of string_to_sid calls.
use strchr instead
(This used to be commit 1c478ca1723558cc5dde693b4abacb56bd98cd43)
1998-12-02 16:01:40 +00:00
John Terpstra
87f4eea109 Updated HEAD branch version to 2.1.0-prealpha in response to a user
complaint about confusion because both the HEAD and SAMBA_2_0 reported
the same version info.
(This used to be commit 195b860b46b78a6a2dd83909477dbc2e9af8f845)
1998-12-02 13:20:18 +00:00
Luke Leighton
51534a4b97 adding group member code, made a start. found that the group members'
rid is needed not the name (see DOMAIN_GRP_MEMBER) decided to go home.
(This used to be commit 9337049dfc98becfa74522d418dae64a97c7a304)
1998-12-02 01:13:02 +00:00
Luke Leighton
f768238582 ok. unix-nt mapping code issues
need to check, when looking up group members, that a group member is
a unix user [being mapped to an nt user] FIRST then if that fails
check that a group member is a unix group [being mapped to an nt group].

why?  because you can have group names in a unix /etc/group file with
the same name as users.

this _might_ be a problem...
(This used to be commit 585d47644d3d709ccdfd5135c5f77166b609eb3b)
1998-12-01 23:51:17 +00:00
Luke Leighton
08cdea519c check server role before doing nt user to unix user mapping
(This used to be commit 9d4e810e7dd8d6d80b47204636f9a37774f95455)
1998-12-01 22:39:33 +00:00
Luke Leighton
5dd26daad5 query_aliasmem code. it works (hurrah).
(This used to be commit f7f2516df46dde1671235f788f7689c93d9395ae)
1998-12-01 22:18:48 +00:00
Luke Leighton
b3c1baeb80 fixing smbpasswd to link to smbd to obtain domain sid
(This used to be commit bfb75e58ced1082d3bb7d6b3f3367d50a0ca26ea)
1998-12-01 19:34:58 +00:00
Luke Leighton
04e382fb16 rpc_samr.h parse_samr.c srv_samr.c :
samr_query_aliasmembers (cool!)

util_pwdb.c sids.c nmbd.c server.c smbpasswd.c swat.c :

	pwdb_initialise(BOOL is_server) now creates / reads DOMAIN_NAME.SID
	if is_server is True, and does LsaQueryInfoPolicy(levels 3 and 5)
	to obtain member and pdc sids.
(This used to be commit 3e1eb4f26b67e484b05e1dde94fd4e4dae982631)
1998-12-01 19:10:44 +00:00
Luke Leighton
e2d5123400 andrej spotted that entries _not_ in domain map user were being refused.
modified map_nt_and_unix_names() to never refuse a mapping (returns void
now not BOOL).
(This used to be commit faffcb3c8955dcea3987e2978dc34b4dba580167)
1998-12-01 18:24:23 +00:00
Luke Leighton
308da9e82b hm. removed the "if failed to map nt name to unix name, fail tcon call"
restriction and "domain user map" seems to work.

amazing.
(This used to be commit 2c0d91e64a6b330b209ca62c3306ec1a53fda873)
1998-12-01 16:41:34 +00:00
Luke Leighton
2d6525f477 fix to domain_namemap (domain, ntname wrong way round oops)
stupid compile errors with file_rename() call just created.
(This used to be commit f5cedb8c9618b83b63b5e2db867d238eebc7e13c)
1998-12-01 16:22:09 +00:00
Luke Leighton
67638b8d2b adding some samr parsing calls (group / alias adding / deleting)
added code that moves MACHINE.SID to DOMAIN_NAME.SID if it exists.
(This used to be commit 51c1c31768a92d9c57ee6c09b78419bcbc544f03)
1998-12-01 16:04:24 +00:00
Luke Leighton
c6ad04b8fb attempting to fix "domain user map" up, but it's a bit complicated.
i may simply go for a response in the NetSamLogon returning the
unix username, forcing the NT user to appear to be a unix user,
however even that is fraught with implications.

might just have to go the whole hog and do this tuple thing,
"unix_name + nt_name" always associated together...


issue with api_net_sam_logon, getsam21pwent() being called twice,
the second time overwriting static buffer data (argh) so had to
make a copy.

noticed a nested "become_root()"/"unbecome_root()" which will have
to be tracked down...
(This used to be commit 474f94f419a531e33b475249da7efb99ac22f454)
1998-11-30 22:42:13 +00:00
Luke Leighton
279923efd3 passdb.c now calls getpwnam() which returns results in a static buffer.
a call _outside_ of this was _also_ calling getpwnam.   the calls to
getsmbpwnam() were therefore overwriting the static buffer.
(This used to be commit c5ba5fa6feab2884a23b8bcb5dcb349ee1a7c139)
1998-11-30 20:42:49 +00:00
Luke Leighton
dc879e9ca7 pwdb_initialise() in the wrong place: must load smb.conf first. thanks phil.
(This used to be commit 4b5bd4e18cee72aeb76909cf85b1f932393fcfc8)
1998-11-30 19:29:32 +00:00
Michael Warfield
da7a6d46b0 Earlier fix for smbmount timing window was the wrong patch.
My bad...  Earlier one was the patch from the CIFS conference that
didn't work, this fixes...
(This used to be commit 12739f0456e9f707a361bce2fa01b0baaae182d9)
1998-11-30 18:06:29 +00:00
Luke Leighton
0712a56047 moving rpc/rpc.h to after netinet.h
(This used to be commit 3257b72c6e2722a6de6b40b4c16e934c02a7c508)
1998-11-30 17:55:46 +00:00
Luke Leighton
b31c528146 another attempt at a fix on connect_serverlist()...
(This used to be commit 603c5f6df8c525f30d00da912d408b98378ea538)
1998-11-30 16:00:27 +00:00
Luke Leighton
013ff4d6b2 builtin alias password API
(This used to be commit 58c0f0a77c396a6021596c84d4a30b1c9a4b1419)
1998-11-30 15:42:40 +00:00
Luke Leighton
7f63a31062 andrej spotted problem with connect_serverlist (starts off assuming
a connection succeeds...).
(This used to be commit c0efc35b27d50c40bc04bfd9fb1d61ea5d32bde5)
1998-11-30 15:32:15 +00:00
Luke Leighton
31044dd8e6 - adding builtin[alias]db.
- lib/sids.c:

	generate_sam_sid() modified to take a domain name: it now
	generates "DOMAIN_NAME.SID".  reasons:

	1) if you run multiple samba servers on the same machine
	under different netbios names as members of a domain,
	they won't all use the same SID, which is a _big_ mistake
	but it would happen _by default_.

	2) we have (had) a problem with sid_to_string() and string_to_sid()
	which cause SIDs to be incorrectly read.  one of the major
	reasons for *NOT* making this change was so as not to disrupt
	existing users.  but as they will be anyway by this bug,
	we might as well go ahead.

- passdb/smbpass.c:

	wanted to change the meaning of the name in the smbpasswd
	file to an "nt" name not a "unix" name.  this is probably
	not a good idea: reverted this.

- output formatting / bug-fixing in rpcclient query_useraliases code.
(This used to be commit e4930f5f48f8246ceec8add8bf769954a963190c)
1998-11-30 15:08:58 +00:00
Luke Leighton
130e971942 cvs getting it wrong. again.
(This used to be commit 776abe3fe52748b9d2939ff77f8a39155894b952)
1998-11-29 20:16:20 +00:00
Luke Leighton
f30539b1b6 enabling optimisation switches on some compiler warnings
(This used to be commit e717b898405fdcd0bb7787394961589aa62cacc3)
1998-11-29 20:08:04 +00:00
Luke Leighton
53373894ac "retired" two modules to preserve their cvs history.
added their replacements, added sam password database API modules
(This used to be commit b1d1c1337c69c6f6bf25ab932a1a6a757e3ea2ae)
1998-11-29 20:06:52 +00:00
Luke Leighton
30038de462 weekend work. user / group database API.
- split sam_passwd and smb_passwd into separate higher-order function tables

- renamed struct smb_passwd's "smb_user" to "unix_user".  added "nt_user"
plus user_rid, and added a "wrap" function in both sam_passwd and smb_passwd
password databases to fill in the blank entries that are not obtained
from whatever password database API instance is being used.

NOTE: whenever a struct smb_passwd or struct sam_passwd is used, it MUST
be initialised with pwdb_sam_init() or pwd_smb_init(), see chgpasswd.c
for the only example outside of the password database APIs i could find.

- added query_useraliases code to rpcclient.

- dealt with some nasty interdependencies involving non-smbd programs
and the password database API.  this is still not satisfactorily
resolved completelely, but it's the best i can do for now.

- #ifdef'd out some password database options so that people don't
mistakenly set them unless they recompile to _use_ those options.

lots of debugging done, it's still not finished.  the unix/NT uid/gid
and user-rid/group-rid issues are better, but not perfect.  the "BUILTIN"
domain is still missing: users cannot be added to "BUILTIN" groups yet,
as we only have an "alias" db API and a "group" db API but not "builtin-alias"
db API...
(This used to be commit 5d5d7e4de7d1514ab87b07ede629de8aa00519a1)
1998-11-29 20:03:33 +00:00
Andrew Tridgell
534e6a2e1b removed include of net/route.h because it prevents compilation under
SCO 3.2 (including it also requires lots of streams stuff, making it a
total mess).

If this causes problems on some other platform then please add a
comment stating what platform and why the include is needed so we can
work out how to test for it properly.
(This used to be commit 21d779bf7def71d5d9c899eabbb6a110860bd8e2)
1998-11-29 09:29:24 +00:00
Andrew Tridgell
6192feac17 don't allow ".." in service name when doing "default service"
processing.
(This used to be commit 702263bba555a1d7c7999d40e5789b7e920dbce4)
1998-11-29 06:23:16 +00:00