remove faked_create_user() BUILD_FARM hack as we have nss_wrapper now
authorStefan Metzmacher <metze@samba.org>
Thu, 18 Oct 2007 15:13:01 +0000 (17:13 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 9 Nov 2007 08:53:02 +0000 (09:53 +0100)
metze
(This used to be commit fc98c1904865608509a01911afa46de74873ef41)

source3/lib/system.c
source3/passdb/pdb_interface.c

index fe4e700176c28b813c73cc6d2663b7955ed2bf4e..321bca83bb19bc8185d5c134826619213eaaa6fb 100644 (file)
@@ -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);
index 0347ea8e56a2328785d454cf81f12884144e171a..c55d3250803d3d054568f66c126be066779ba0d3 100644 (file)
@@ -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);