version 1.1, 2000/06/18 22:07:24 |
version 1.2, 2000/06/19 03:23:03 |
|
|
{ |
{ |
int i = 0; |
int i = 0; |
char pass[_PASSWORD_LEN], *cypher; |
char pass[_PASSWORD_LEN], *cypher; |
char tcfskey[KEYSIZE + 2]; |
char tcfskey[2*KEYSIZE]; |
des_key_schedule ks; |
des_key_schedule ks; |
int keysize = (flag == GROUPKEY) ? KEYSIZE + KEYSIZE/8 : KEYSIZE; |
int keysize = (flag == GROUPKEY) ? KEYSIZE + KEYSIZE/8 : KEYSIZE; |
|
|
|
|
|
|
strcpy (pass, pwd); |
strcpy (pass, pwd); |
|
|
if (uudecode ((char *)t, tcfskey, sizeof(tcfskey)) == -1) |
if (uudecode ((char *)t, tcfskey, sizeof(tcfskey)) == -1) { |
|
fprintf(stderr, "tcfs_decrypt_key: uudecode failed\n"); |
return 0; |
return 0; |
|
} |
|
|
while (strlen (pass) < 8) { |
while (strlen (pass) < 8) { |
char tmp[_PASSWORD_LEN]; |
char tmp[_PASSWORD_LEN]; |
|
|
char pass[_PASSWORD_LEN]; |
char pass[_PASSWORD_LEN]; |
des_key_schedule ks; |
des_key_schedule ks; |
int keysize = (flag == GROUPKEY) ? KEYSIZE + KEYSIZE/8 : KEYSIZE; |
int keysize = (flag == GROUPKEY) ? KEYSIZE + KEYSIZE/8 : KEYSIZE; |
|
int uulen = (flag == GROUPKEY) ? UUGKEYSIZE : UUKEYSIZE; |
|
int res; |
|
|
if (!ek) |
if (!ek) |
return 0; |
return 0; |
|
|
i++; |
i++; |
} |
} |
|
|
uuencode (key, keysize, ek, UUKEYSIZE); |
res = uuencode (key, keysize, ek, uulen + 1); |
|
if (res != uulen) { |
|
fprintf(stderr, "tcfs_encrypt_key: uuencode length wrong\n"); |
|
return (0); |
|
} |
|
|
return 1; |
return 1; |
} |
} |
|
|
int tcfs_user_enable(char *filesystem, uid_t user, u_char *key) |
int |
|
tcfs_user_enable(char *filesystem, uid_t user, u_char *key) |
{ |
{ |
struct tcfs_args a; |
struct tcfs_args a; |
a.user = user; |
a.user = user; |
|
|
return tcfs_callfunction(filesystem,&a); |
return tcfs_callfunction(filesystem,&a); |
} |
} |
|
|
int tcfs_user_disable(char *filesystem, uid_t user) |
int |
|
tcfs_user_disable(char *filesystem, uid_t user) |
{ |
{ |
struct tcfs_args a; |
struct tcfs_args a; |
a.user = user; |
a.user = user; |
|
|
return tcfs_callfunction(filesystem, &a); |
return tcfs_callfunction(filesystem, &a); |
} |
} |
|
|
int tcfs_proc_enable(char *filesystem, uid_t user, pid_t pid, char *key) |
int |
|
tcfs_proc_enable(char *filesystem, uid_t user, pid_t pid, char *key) |
{ |
{ |
struct tcfs_args a; |
struct tcfs_args a; |
a.user = user; |
a.user = user; |
|
|
return tcfs_callfunction(filesystem, &a); |
return tcfs_callfunction(filesystem, &a); |
} |
} |
|
|
int tcfs_proc_disable(char *filesystem, uid_t user, pid_t pid) |
int |
|
tcfs_proc_disable(char *filesystem, uid_t user, pid_t pid) |
{ |
{ |
struct tcfs_args a; |
struct tcfs_args a; |
a.user = user; |
a.user = user; |
|
|
return tcfs_callfunction(filesystem, &a); |
return tcfs_callfunction(filesystem, &a); |
} |
} |
|
|
int tcfs_group_enable(char *filesystem, uid_t uid, gid_t gid, |
int |
int tre, char *key) |
tcfs_group_enable(char *filesystem, uid_t uid, gid_t gid, |
|
int tre, char *key) |
{ |
{ |
struct tcfs_args a; |
struct tcfs_args a; |
a.cmd = TCFS_PUT_GIDKEY; |
a.cmd = TCFS_PUT_GIDKEY; |