/[man-db]/man-db/src/manp.c
ViewVC logotype

Diff of /man-db/src/manp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.30 by cjwatson, Wed Jul 30 21:29:19 2003 UTC revision 1.31 by cjwatson, Fri Aug 1 00:06:47 2003 UTC
# Line 649  extern uid_t euid;                     /* initial effectiv Line 649  extern uid_t euid;                     /* initial effectiv
649  static void  static void
650  mkcatdirs (const char *mandir, const char *catdir)  mkcatdirs (const char *mandir, const char *catdir)
651  {  {
652          char manname[PATH_MAX+6];          char *manname, *catname;
         char catname[PATH_MAX+6];  
653  #ifdef SECURE_MAN_UID  #ifdef SECURE_MAN_UID
654          struct passwd *man_owner = get_man_owner ();          struct passwd *man_owner = get_man_owner ();
655  #endif  #endif
# Line 679  mkcatdirs (const char *mandir, const cha Line 678  mkcatdirs (const char *mandir, const cha
678                          drop_effective_privs ();                          drop_effective_privs ();
679                  }                  }
680                  /* then the hierarchy */                  /* then the hierarchy */
681                  sprintf (catname, "%s/cat1", catdir);                  catname = strappend (NULL, catdir, "/cat1", NULL);
682                    manname = strappend (NULL, mandir, "/man1", NULL);
683                  if (is_directory (catdir) == 1) {                  if (is_directory (catdir) == 1) {
684                          int j;                          int j;
685                          regain_effective_privs ();                          regain_effective_privs ();
# Line 688  mkcatdirs (const char *mandir, const cha Line 688  mkcatdirs (const char *mandir, const cha
688                                           "creating catdir hierarchy %s  ",                                           "creating catdir hierarchy %s  ",
689                                           catdir);                                           catdir);
690                          for (j = 1; j <= 9; j++) {                          for (j = 1; j <= 9; j++) {
691                                  sprintf (catname, "%s/cat%d", catdir, j);                                  catname[strlen (catname) - 1] = '0' + j;
692                                  sprintf (manname, "%s/man%d", mandir, j);                                  manname[strlen (manname) - 1] = '0' + j;
693                                  if ((is_directory (manname) == 1)                                  if ((is_directory (manname) == 1)
694                                   && (is_directory (catname) != 1)) {                                   && (is_directory (catname) != 1)) {
695                                          if (mkdir (catname,                                          if (mkdir (catname,
# Line 711  mkcatdirs (const char *mandir, const cha Line 711  mkcatdirs (const char *mandir, const cha
711                                  fprintf (stderr, "\n");                                  fprintf (stderr, "\n");
712                          drop_effective_privs ();                          drop_effective_privs ();
713                  }                  }
714                    free (catname);
715                    free (manname);
716                  umask (oldmask);                  umask (oldmask);
717          }          }
718  }  }

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26