smbldap-usershow prints dates in non-human-readable form

Bug #141091 reported by Rubin
2
Affects Status Importance Assigned to Milestone
smbldap-tools (Ubuntu)
Invalid
Wishlist
Unassigned

Bug Description

Binary package hint: smbldap-tools

Several values in smbldap-usershow are dates, but not shown as dates. I don't know if there is a more portable way to tell, but in any case the following patch at least converts the known list of attributes below to human-readable dates.

(note: this patch depends on the patch from #141084 to apply correctly)

smbldap-usershow appears to be the only built in tool which uses the read_user function..

--- smbldap-tools-0.9.4-rubin-1/smbldap_tools.pm 2007-09-19 15:57:46.446805000 -0500
+++ smbldap-tools-0.9.4-rubin-2/smbldap_tools.pm 2007-09-19 16:21:57.792233000 -0500
@@ -777,11 +777,21 @@
        foreach my $attr ($entry->attributes) {
            my @vals = $entry->get_value($attr);
            foreach my $val (@vals) {
                $val="**UNPRINTABLE**" if ( $val =~ /[^[:print:]]/ );
            }
- $lines.= $attr.": ".join(',', @vals)."\n";
+ if ( $attr eq "shadowLastChange" or $attr eq "shadowExpire" or
+ $attr eq "sambaPwdLastSet" or $attr eq "sambaPwdCanChange" or
+ $attr eq "sambaPwdMustChange" or $attr eq "sambaLogoffTime" or
+ $attr eq "sambaKickoffTime") {
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime ($entry->get_value($attr) * 24 * 60 * 60);
+ $year += 1900;
+ $mon += 1;
+ $lines.= $attr.": $mon/$mday/$year\n";
+ } else {
+ $lines.= $attr.": ".join(',', @vals)."\n";
+ }
        }
     }
     chomp $lines;
     if ($lines eq '') {
        return undef;

Tags: patch
Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 RC or later?

Changed in smbldap-tools:
importance: Undecided → Wishlist
status: New → Incomplete
Revision history for this message
Pedro Villavicencio (pedro) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to New. Thanks again!.

Changed in smbldap-tools:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.