From 7c30e1432bafd2c8065dddcdb99a46e64e997b18 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 12 May 2023 11:33:10 -0400 Subject: ustar: Support writing device major and minor --- (limited to 'src/ustar.c') diff --git a/src/ustar.c b/src/ustar.c index 359f967..669596e 100644 --- a/src/ustar.c +++ b/src/ustar.c @@ -280,6 +280,7 @@ int opkg_opk_ustar_write_header(struct opkg_opk_ustar *ustar, struct opkg_opk_dirent *dirent, uint16_t mode, uid_t uid, const char *uname, gid_t gid, const char *gname, + uint32_t devmajor, uint32_t devminor, uint64_t size, uint64_t mtime, char type, const char *linkname) { uint32_t chksum; @@ -302,11 +303,13 @@ opkg_opk_ustar_write_header(struct opkg_opk_ustar *ustar, * even checking endptr, so we have to NUL-terminate these fields. Also * parsing these fields with strtol() are our very own * _opkg_opk_ustar_next() and opkg_opk_ustar_list() above. */ - sprintf(ustar->header.mode, "%07o", mode); - sprintf(ustar->header.uid, "%07o", uid); - sprintf(ustar->header.gid, "%07o", gid); - sprintf(ustar->header.size, "%011o", size); - sprintf(ustar->header.mtime, "%011o", mtime); + sprintf(ustar->header.mode, "%07o", mode); + sprintf(ustar->header.uid, "%07o", uid); + sprintf(ustar->header.gid, "%07o", gid); + sprintf(ustar->header.size, "%011o", size); + sprintf(ustar->header.mtime, "%011o", mtime); + sprintf(ustar->header.devmajor, "%07o", devmajor); + sprintf(ustar->header.devminor, "%07o", devminor); switch (type) { case '-': /* Regular file */ *ustar->header.typeflag = '0'; -- cgit v0.9.1