fail if we get a bad owner/group
authorroot <devnull@localhost>
Thu, 27 Feb 1997 04:32:38 +0000 (04:32 +0000)
committerroot <devnull@localhost>
Thu, 27 Feb 1997 04:32:38 +0000 (04:32 +0000)
CVS patchset: 1462
CVS date: 1997/02/27 04:32:38

build/files.c

index 444794b..da661f9 100644 (file)
@@ -240,6 +240,10 @@ int process_filelist(Header header, struct PackageRec *pr,
            stat(filename, &fest->statbuf);
            fest->uname = getUname(fest->statbuf.st_uid);
            fest->gname = getGname(fest->statbuf.st_gid);
+           if (! (fest->uname && fest->gname)) {
+               rpmError(RPMERR_BADSPEC, "Bad owner/group: %s", filename);
+               return(RPMERR_BADSPEC);
+           }
            strcpy(fest->file, filename);
            fest->next = fes;
            fes = fest;
@@ -598,6 +602,11 @@ static int add_file(struct file_entry **festack, const char *name,
        p->gname = getGname(p->statbuf.st_gid);
     }
     
+    if (! (p->uname && p->gname)) {
+       fprintf(stderr, "Bad owner/group: %s\n", fullname);
+       exit(1);
+    }
+    
     if ((! isdir) && S_ISDIR(p->statbuf.st_mode)) {
        /* This means we need to descend with ftw() */
        Gcount = 0;