Changeset View
Changeset View
Standalone View
Standalone View
smb/kio_smb_browse.cpp
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 73 | { | |||
---|---|---|---|---|---|
75 | warning(i18n("%1:\n" | 75 | warning(i18n("%1:\n" | ||
76 | "Unknown file type, neither directory or file.", url.toDisplayString())); | 76 | "Unknown file type, neither directory or file.", url.toDisplayString())); | ||
77 | return EINVAL; | 77 | return EINVAL; | ||
78 | } | 78 | } | ||
79 | 79 | | |||
80 | udsentry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, st.st_mode & S_IFMT); | 80 | udsentry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, st.st_mode & S_IFMT); | ||
81 | udsentry.fastInsert(KIO::UDSEntry::UDS_SIZE, st.st_size); | 81 | udsentry.fastInsert(KIO::UDSEntry::UDS_SIZE, st.st_size); | ||
82 | 82 | | |||
83 | QString str; | 83 | // UID and GID **must** not be mapped. The values returned by libsmbclient are | ||
84 | uid_t uid = st.st_uid; | 84 | // simply the getuid/getgid of the process. They mean absolutely nothing. | ||
85 | struct passwd *user = getpwuid( uid ); | 85 | // Also see libsmb_stat.c. | ||
86 | if ( user ) | 86 | // Related: https://bugs.kde.org/show_bug.cgi?id=212801 | ||
87 | str = user->pw_name; | | |||
88 | else | | |||
89 | str = QString::number( uid ); | | |||
90 | udsentry.fastInsert(KIO::UDSEntry::UDS_USER, str); | | |||
91 | | ||||
92 | gid_t gid = st.st_gid; | | |||
93 | struct group *grp = getgrgid( gid ); | | |||
94 | if ( grp ) | | |||
95 | str = grp->gr_name; | | |||
96 | else | | |||
97 | str = QString::number( gid ); | | |||
98 | udsentry.fastInsert(KIO::UDSEntry::UDS_GROUP, str); | | |||
99 | 87 | | |||
100 | udsentry.fastInsert(KIO::UDSEntry::UDS_ACCESS, st.st_mode & 07777); | 88 | udsentry.fastInsert(KIO::UDSEntry::UDS_ACCESS, st.st_mode & 07777); | ||
101 | udsentry.fastInsert(KIO::UDSEntry::UDS_MODIFICATION_TIME, st.st_mtime); | 89 | udsentry.fastInsert(KIO::UDSEntry::UDS_MODIFICATION_TIME, st.st_mtime); | ||
102 | udsentry.fastInsert(KIO::UDSEntry::UDS_ACCESS_TIME, st.st_atime); | 90 | udsentry.fastInsert(KIO::UDSEntry::UDS_ACCESS_TIME, st.st_atime); | ||
103 | // No, st_ctime is not UDS_CREATION_TIME... | 91 | // No, st_ctime is not UDS_CREATION_TIME... | ||
104 | } | 92 | } | ||
105 | 93 | | |||
106 | return cacheStatErr; | 94 | return cacheStatErr; | ||
▲ Show 20 Lines • Show All 567 Lines • Show Last 20 Lines |