[BACK]Return to tcfs_dbmaint.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tcfs

Diff for /src/usr.bin/tcfs/Attic/tcfs_dbmaint.c between version 1.2 and 1.3

version 1.2, 2000/06/18 22:26:56 version 1.3, 2000/06/19 03:23:01
Line 229 
Line 229 
         DB *pdb;          DB *pdb;
         DBT srchkey, r;          DBT srchkey, r;
         char *key, *buf;          char *key, *buf;
           int res;
   
         if (!*dest)          if (!*dest)
                 if (!tcfsgpwdbr_new (dest))                  if (!tcfsgpwdbr_new (dest))
Line 243 
Line 244 
                 return NULL;                  return NULL;
   
         sprintf (key, "%s\33%d\0", user, (int)gid);          sprintf (key, "%s\33%d\0", user, (int)gid);
         srchkey.data=key;          srchkey.data = key;
         srchkey.size=(int)strlen (key);          srchkey.size = (int)strlen (key);
   
         if (pdb->get(pdb, &srchkey, &r, 0)) {          if ((res = pdb->get(pdb, &srchkey, &r, 0))) {
                   if (res == -1)
                           perror("dbget");
                 pdb->close (pdb);                  pdb->close (pdb);
                 return (NULL);                  return (NULL);
         }          }
Line 306 
Line 309 
         char *tmp;          char *tmp;
   
         open_flag = O_RDWR|O_EXCL;          open_flag = O_RDWR|O_EXCL;
         if (access (TCFSPWDB, F_OK) < 0)          if (access (TCFSGPWDB, F_OK) < 0)
                 open_flag |= O_CREAT;                  open_flag |= O_CREAT;
   
         pdb = dbopen (TCFSPWDB, open_flag, PERM_SECURE, DB_HASH, NULL);          pdb = dbopen (TCFSGPWDB, open_flag, PERM_SECURE, DB_HASH, NULL);
         if (!pdb)          if (!pdb) {
                   perror("dbopen");
                 return 0;                  return 0;
           }
   
         key = (char *) calloc (strlen(src->user) + 4 + 1, sizeof(char));          key = (char *) calloc (strlen(src->user) + 4 + 1, sizeof(char));
         sprintf (key, "%s\33%d\0", src->user, src->gid);          sprintf (key, "%s\33%d\0", src->user, src->gid);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3