Remove obsolete code

master
Michael Spang 2009-01-31 01:53:10 -05:00
parent 64f10c6009
commit 6752ed1bc4
6 changed files with 0 additions and 103 deletions

View File

@ -12,12 +12,10 @@
#include <syslog.h>
#include "util.h"
#include "common.h"
#include "config.h"
#include "ldap.h"
#include "krb5.h"
#include "kadm.h"
#include "addhomedir.h"
#include "ceo.pb-c.h"
char *prog = NULL;

View File

@ -1,35 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/acl.h>
#include <dirent.h>
#include <pwd.h>
#include <fcntl.h>
#include <assert.h>
#include "addhomedir.h"
#include "util.h"
#include "config.h"
#include "krb5.h"
int ceo_create_home(char *homedir, char *refquota, uid_t uid, gid_t gid, char *mode, char *acl) {
char uid_str[16], gid_str[16];
char *zfs_argv[] = { "ssh", "ceo@ginseng", "/usr/sbin/zfsaddhomedir", \
homedir, refquota, skeleton_dir, uid_str, gid_str, mode, acl, NULL };
int ret = 0;
assert(homedir[0]);
snprintf(uid_str, sizeof(uid_str), "%ld", (long)uid);
snprintf(gid_str, sizeof(gid_str), "%ld", (long)uid);
if(!acl[0]) acl = NULL;
ceo_krb5_auth(admin_bind_userid, admin_bind_keytab);
if(spawnv("/usr/bin/ssh", zfs_argv)) {
errorpe("failed calling zfsaddhomedir for %s", homedir);
ret = -1;
}
ceo_krb5_deauth();
return ret;
}

View File

@ -1,3 +0,0 @@
#include <sys/types.h>
int ceo_create_home(char *, char *, uid_t, gid_t, char *, char *);

View File

@ -12,12 +12,10 @@
#include <syslog.h>
#include "util.h"
#include "common.h"
#include "config.h"
#include "ldap.h"
#include "krb5.h"
#include "kadm.h"
#include "addhomedir.h"
#include "ceo.pb-c.h"
char *prog = NULL;

View File

@ -1,58 +0,0 @@
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include "common.h"
#include "util.h"
#include "config.h"
int ceo_get_privileged() {
int uid = getuid();
// root is privileged
if (!uid)
return 1;
if (privileged_group) {
struct group *privgrp = getgrnam(privileged_group);
int pgid;
gid_t grps[128];
int count, i;
if (!privgrp)
return 0;
pgid = privgrp->gr_gid;
count = getgroups(sizeof(grps), grps);
for (i = 0; i < count; i++)
if (grps[i] == pgid)
return 1;
}
return 0;
}
char *ceo_get_user() {
struct passwd *pwent = getpwuid(getuid());
if (pwent == NULL)
fatal("could not determine user");
return xstrdup(pwent->pw_name);
}
void ceo_notify_hook(int argc, ...) {
va_list args;
char **argv;
int i = 0;
va_start(args, argc);
argv = (char **)xmalloc(sizeof(char *) * (argc + 1));
while (i < argc)
argv[i++] = va_arg(args, char *);
argv[i++] = NULL;
spawnv(notify_hook, argv);
va_end(args);
}

View File

@ -1,3 +0,0 @@
int ceo_get_privileged();
char *ceo_get_user();
void ceo_notify_hook(int, ...);