Fix arguments mismatch insanity

My reverting some of dtbartle's zfs-related stuff left us with a
hybrid zfsaddhomedir that was insane. This became a simpleaddhomedir
that was almost as insane.
pull/5/head
Michael Spang 14 years ago
parent b523fbf206
commit c4b021b4f6
  1. 2
      src/addhomedir.c
  2. 6
      src/simpleaddhomedir.c

@ -16,7 +16,7 @@
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/simpleaddhomedir", \
homedir, refquota, skeleton_dir, uid_str, gid_str, mode, acl, NULL };
homedir, skeleton_dir, uid_str, gid_str, mode, NULL };
int ret = 0;
assert(homedir[0]);

@ -16,13 +16,12 @@ int main(int argc, char *argv[]) {
char *homedir = argv[1];
char *skeldir = argv[2];
char *mode = argv[5];
uid_t uid, gid;
char *mkdir_bin = "/bin/mkdir";
char *chmod_bin = "/bin/chmod";
char *dataset = homedir;
char *create_argv[] = { "mkdir", dataset, NULL };
char *mode_argv[] = { "chmod", mode, homedir, NULL };
char *mode_argv[] = { "chmod", "0755", homedir, NULL };
DIR *skel;
struct dirent *skelent;
@ -30,6 +29,9 @@ int main(int argc, char *argv[]) {
uid = atol(argv[3]);
gid = atol(argv[4]);
if (setreuid(0, 0))
fatalpe("ogawd");
if(spawnv(mkdir_bin, create_argv))
return 1;
//Quotas are ignored now, or so I'm told.

Loading…
Cancel
Save