Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 124314
Collapse All | Expand All

(-)src/cfkey.c (-6 / +12 lines)
Lines 34-45 Link Here
34
34
35
char CFLOCK[CF_BUFSIZE];
35
char CFLOCK[CF_BUFSIZE];
36
36
37
void Initialize ARGLIST((void));
37
void Initialize ARGLIST((const char *));
38
int RecursiveTidySpecialArea ARGLIST((char *name, struct Tidy *tp, int maxrecurse, struct stat *sb));
38
int RecursiveTidySpecialArea ARGLIST((char *name, struct Tidy *tp, int maxrecurse, struct stat *sb));
39
39
40
/*****************************************************************************/
40
/*****************************************************************************/
41
41
42
int main()
42
int main(int argc, char **argv)
43
43
44
{ unsigned long err;
44
{ unsigned long err;
45
  RSA *pair;
45
  RSA *pair;
Lines 50-56 Link Here
50
  EVP_CIPHER *cipher = EVP_des_ede3_cbc();
50
  EVP_CIPHER *cipher = EVP_des_ede3_cbc();
51
51
52
52
53
Initialize();
53
  if (argc > 1)
54
    if (argv[1][0] != '/') {
55
      fprintf(stderr, "%s: Must use explicit full paths when using a root prefix\n", argv[1]);
56
      exit(1);
57
    }
58
Initialize(argc > 1 ? argv[1] : "");
54
 
59
 
55
if (stat(CFPRIVKEYFILE,&statbuf) != -1)
60
if (stat(CFPRIVKEYFILE,&statbuf) != -1)
56
   {
61
   {
Lines 143-155 Link Here
143
/* Level 1                                                         */
148
/* Level 1                                                         */
144
/*******************************************************************/
149
/*******************************************************************/
145
150
146
void Initialize()
151
void Initialize(const char *root)
147
152
148
{
153
{
149
umask(077);
154
  umask(077);
155
150
 /* XXX Initialize workdir for non privileged users */
156
 /* XXX Initialize workdir for non privileged users */
151
157
152
 strcpy(CFWORKDIR,WORKDIR);
158
 snprintf(CFWORKDIR, sizeof(CFWORKDIR), "%s%s", root, WORKDIR);
153
159
154
 if (geteuid() > 0)
160
 if (geteuid() > 0)
155
    {
161
    {

Return to bug 124314