]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/attr.c
kes Correctly detect Ubuntu systems, and add ubuntu platform directory.
[bacula/bacula] / bacula / src / lib / attr.c
index cbe673f1cbda4c378f5526db7d86e53f76284865..5e5210e4af538903762c136e07c918870f00016d 100644 (file)
 #include "jcr.h"
 #include "lib/breg.h"
 
-ATTR *new_attr()
+ATTR *new_attr(JCR *jcr)
 {
    ATTR *attr = (ATTR *)malloc(sizeof(ATTR));
    memset(attr, 0, sizeof(ATTR));
    attr->ofname = get_pool_memory(PM_FNAME);
    attr->olname = get_pool_memory(PM_FNAME);
    attr->attrEx = get_pool_memory(PM_FNAME);
+   attr->jcr = jcr;
+   attr->uid = getuid();
    return attr;
 }
 
@@ -240,6 +242,14 @@ void print_ls_output(JCR *jcr, ATTR *attr)
    char *p, *f;
    guid_list *guid;
 
+   if (attr->type == FT_DELETED) { /* TODO: change this to get last seen values */
+      bsnprintf(buf, sizeof(buf),
+               "----------   - -        -                - ---------- --------  %s\n", attr->ofname);
+      Dmsg1(20, "%s", buf);
+      Jmsg(jcr, M_RESTORED, 1, "%s", buf);
+      return;
+   }
+
    if (!jcr->id_list) {
       jcr->id_list = new_guid_list();
    }
@@ -249,7 +259,7 @@ void print_ls_output(JCR *jcr, ATTR *attr)
    p += sprintf(p, "%-8.8s %-8.8s", 
                 guid->uid_to_name(attr->statp.st_uid, en1, sizeof(en1)),
                 guid->gid_to_name(attr->statp.st_gid, en2, sizeof(en2)));
-   p += sprintf(p, "%10.10s ", edit_uint64(attr->statp.st_size, ec1));
+   p += sprintf(p, "%10.10s ", edit_int64(attr->statp.st_size, ec1));
    p = encode_time(attr->statp.st_ctime, p);
    *p++ = ' ';
    *p++ = ' ';