diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-10-18 17:13:01 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-11-09 09:53:02 +0100 |
commit | fdc27be1be4cb82a3db97ba6f519f4ce78c3bf92 (patch) | |
tree | fa47ffae562ca9c61e0fee83bff8f7540f603d42 /source3 | |
parent | cfec6c3083544599a4047863e1f109ee8fb80283 (diff) | |
download | samba-fdc27be1be4cb82a3db97ba6f519f4ce78c3bf92.tar.gz samba-fdc27be1be4cb82a3db97ba6f519f4ce78c3bf92.tar.bz2 samba-fdc27be1be4cb82a3db97ba6f519f4ce78c3bf92.zip |
remove faked_create_user() BUILD_FARM hack as we have nss_wrapper now
metze
(This used to be commit fc98c1904865608509a01911afa46de74873ef41)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/system.c | 77 | ||||
-rw-r--r-- | source3/passdb/pdb_interface.c | 8 |
2 files changed, 0 insertions, 85 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c index fe4e700176..321bca83bb 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -1056,81 +1056,6 @@ void sys_endpwent(void) Wrappers for getpwnam(), getpwuid(), getgrnam(), getgrgid() ****************************************************************************/ -#ifdef ENABLE_BUILD_FARM_HACKS - -/* - * In the build farm we want to be able to join machines to the domain. As we - * don't have root access, we need to bypass direct access to /etc/passwd - * after a user has been created via samr. Fake those users. - */ - -static struct passwd *fake_pwd; -static int num_fake_pwd; - -struct passwd *sys_getpwnam(const char *name) -{ - int i; - - for (i=0; i<num_fake_pwd; i++) { - if (strcmp(fake_pwd[i].pw_name, name) == 0) { - DEBUG(10, ("Returning fake user %s\n", name)); - return &fake_pwd[i]; - } - } - - return getpwnam(name); -} - -struct passwd *sys_getpwuid(uid_t uid) -{ - int i; - - for (i=0; i<num_fake_pwd; i++) { - if (fake_pwd[i].pw_uid == uid) { - DEBUG(10, ("Returning fake user %s\n", - fake_pwd[i].pw_name)); - return &fake_pwd[i]; - } - } - - return getpwuid(uid); -} - -void faked_create_user(const char *name) -{ - int i; - uid_t uid; - struct passwd new_pwd; - - for (i=0; i<10; i++) { - generate_random_buffer((unsigned char *)&uid, - sizeof(uid)); - if (getpwuid(uid) == NULL) { - break; - } - } - - if (i==10) { - /* Weird. No free uid found... */ - return; - } - - new_pwd.pw_name = SMB_STRDUP(name); - new_pwd.pw_passwd = SMB_STRDUP("x"); - new_pwd.pw_uid = uid; - new_pwd.pw_gid = 100; - new_pwd.pw_gecos = SMB_STRDUP("faked user"); - new_pwd.pw_dir = SMB_STRDUP("/nodir"); - new_pwd.pw_shell = SMB_STRDUP("/bin/false"); - - ADD_TO_ARRAY(NULL, struct passwd, new_pwd, &fake_pwd, - &num_fake_pwd); - - DEBUG(10, ("Added fake user %s, have %d fake users\n", - name, num_fake_pwd)); -} - -#else struct passwd *sys_getpwnam(const char *name) { @@ -1142,8 +1067,6 @@ struct passwd *sys_getpwuid(uid_t uid) return getpwuid(uid); } -#endif - struct group *sys_getgrnam(const char *name) { return getgrnam(name); diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index 0347ea8e56..c55d325080 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -347,14 +347,6 @@ static NTSTATUS pdb_default_create_user(struct pdb_methods *methods, smb_nscd_flush_user_cache(); } -#ifdef ENABLE_BUILD_FARM_HACKS - if (add_ret != 0) { - DEBUG(1, ("Creating a faked user %s for build farm " - "purposes\n", name)); - faked_create_user(name); - } -#endif - flush_pwnam_cache(); pwd = Get_Pwnam_alloc(tmp_ctx, name); |