Changeset View
Changeset View
Standalone View
Standalone View
smb/kio_smb_browse.cpp
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | 80 | if (!S_ISDIR(st.st_mode)) { | |||
---|---|---|---|---|---|
90 | if (st.st_mode & S_IXOTH) { // DOS hidden | 90 | if (st.st_mode & S_IXOTH) { // DOS hidden | ||
91 | udsentry.fastInsert(KIO::UDSEntry::UDS_HIDDEN, true); | 91 | udsentry.fastInsert(KIO::UDSEntry::UDS_HIDDEN, true); | ||
92 | } | 92 | } | ||
93 | } | 93 | } | ||
94 | 94 | | |||
95 | udsentry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, st.st_mode & S_IFMT); | 95 | udsentry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, st.st_mode & S_IFMT); | ||
96 | udsentry.fastInsert(KIO::UDSEntry::UDS_SIZE, st.st_size); | 96 | udsentry.fastInsert(KIO::UDSEntry::UDS_SIZE, st.st_size); | ||
97 | 97 | | |||
98 | QString str; | 98 | // UID and GID **must** not be mapped. The values returned by libsmbclient are | ||
99 | uid_t uid = st.st_uid; | 99 | // simply the getuid/getgid of the process. They mean absolutely nothing. | ||
100 | struct passwd *user = getpwuid( uid ); | 100 | // Also see libsmb_stat.c. | ||
101 | if ( user ) | 101 | // Related: https://bugs.kde.org/show_bug.cgi?id=212801 | ||
102 | str = user->pw_name; | | |||
103 | else | | |||
104 | str = QString::number( uid ); | | |||
105 | udsentry.fastInsert(KIO::UDSEntry::UDS_USER, str); | | |||
106 | | ||||
107 | gid_t gid = st.st_gid; | | |||
108 | struct group *grp = getgrgid( gid ); | | |||
109 | if ( grp ) | | |||
110 | str = grp->gr_name; | | |||
111 | else | | |||
112 | str = QString::number( gid ); | | |||
113 | udsentry.fastInsert(KIO::UDSEntry::UDS_GROUP, str); | | |||
114 | 102 | | |||
115 | udsentry.fastInsert(KIO::UDSEntry::UDS_ACCESS, st.st_mode & 07777); | 103 | udsentry.fastInsert(KIO::UDSEntry::UDS_ACCESS, st.st_mode & 07777); | ||
116 | udsentry.fastInsert(KIO::UDSEntry::UDS_MODIFICATION_TIME, st.st_mtime); | 104 | udsentry.fastInsert(KIO::UDSEntry::UDS_MODIFICATION_TIME, st.st_mtime); | ||
117 | udsentry.fastInsert(KIO::UDSEntry::UDS_ACCESS_TIME, st.st_atime); | 105 | udsentry.fastInsert(KIO::UDSEntry::UDS_ACCESS_TIME, st.st_atime); | ||
118 | // No, st_ctime is not UDS_CREATION_TIME... | 106 | // No, st_ctime is not UDS_CREATION_TIME... | ||
119 | } | 107 | } | ||
120 | 108 | | |||
121 | return cacheStatErr; | 109 | return cacheStatErr; | ||
▲ Show 20 Lines • Show All 570 Lines • Show Last 20 Lines |