fix for LSB compliance
[debian/pax] / tar.c
diff --git a/tar.c b/tar.c
index 97639346d557bddd16a12bf7c7b9cedc5cceb397..2acc32fd5a3b3730b60346c05aa1e51b9861fde2 100644 (file)
--- a/tar.c
+++ b/tar.c
@@ -1079,6 +1079,15 @@ ustar_wr(ARCHD *arcn)
        strncpy(hd->uname, name_uid(arcn->sb.st_uid, 0), sizeof(hd->uname));
        strncpy(hd->gname, name_gid(arcn->sb.st_gid, 0), sizeof(hd->gname));
 
+       /*
+        * Always add devmajor and devminor
+        */
+       if (ul_oct ((u_long) MAJOR (arcn->sb.st_rdev), hd->devmajor,
+             sizeof (hd->devmajor), 3) ||
+           ul_oct ((u_long) MINOR (arcn->sb.st_rdev), hd->devminor,
+             sizeof (hd->devminor), 3))
+               goto out;
+
        /*
         * calculate and store the checksum write the header to the archive
         * return 0 tells the caller to now write the file data, 1 says no data