summaryrefslogtreecommitdiffstats
path: root/source/lib/system.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-10-18 17:13:01 +0200
committerStefan Metzmacher <metze@samba.org>2007-11-09 09:53:02 +0100
commitfc98c1904865608509a01911afa46de74873ef41 (patch)
tree692ab0d44f588c66a74d39d3f78f9f3a3ee7c9ab /source/lib/system.c
parent02cfd283627bd8f10d7beb8d43cead35dd867346 (diff)
downloadsamba-fc98c1904865608509a01911afa46de74873ef41.tar.gz
samba-fc98c1904865608509a01911afa46de74873ef41.tar.xz
samba-fc98c1904865608509a01911afa46de74873ef41.zip
remove faked_create_user() BUILD_FARM hack as we have nss_wrapper now
metze
Diffstat (limited to 'source/lib/system.c')
-rw-r--r--source/lib/system.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/source/lib/system.c b/source/lib/system.c
index fe4e700176c..321bca83bb1 100644
--- a/source/lib/system.c
+++ b/source/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);