Changeset View
Changeset View
Standalone View
Standalone View
smb/kio_smb_browse.cpp
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 71 | { | |||
---|---|---|---|---|---|
72 | if(!S_ISDIR(st.st_mode) && !S_ISREG(st.st_mode)) | 72 | if(!S_ISDIR(st.st_mode) && !S_ISREG(st.st_mode)) | ||
73 | { | 73 | { | ||
74 | qCDebug(KIO_SMB) << "mode: "<< st.st_mode; | 74 | qCDebug(KIO_SMB) << "mode: "<< st.st_mode; | ||
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 | if (!S_ISDIR(st.st_mode)) { | ||||
81 | // Awkwardly documented at | ||||
82 | // https://www.samba.org/samba/docs/using_samba/ch08.html | ||||
83 | // libsmb_stat.c assigns special meaning to +x permissions | ||||
84 | // (obviously only on files, all dirs are +x so this hacky representation | ||||
85 | // wouldn't work!): | ||||
86 | // - S_IXUSR = DOS archive: This file has been touched since the last DOS backup was performed on it. | ||||
87 | // - S_IXGRP = DOS system: This file has a specific purpose required by the operating system. | ||||
88 | // - S_IXOTH = DOS hidden: This file has been marked to be invisible to the user, unless the operating system is explicitly set to show it. | ||||
89 | // Only hiding has backing through KIO right now. | ||||
90 | if (st.st_mode & S_IXOTH) { // DOS hidden | ||||
91 | udsentry.fastInsert(KIO::UDSEntry::UDS_HIDDEN, true); | ||||
92 | } | ||||
93 | } | ||||
94 | | ||||
80 | 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); | ||
81 | udsentry.fastInsert(KIO::UDSEntry::UDS_SIZE, st.st_size); | 96 | udsentry.fastInsert(KIO::UDSEntry::UDS_SIZE, st.st_size); | ||
82 | 97 | | |||
83 | QString str; | 98 | QString str; | ||
84 | uid_t uid = st.st_uid; | 99 | uid_t uid = st.st_uid; | ||
85 | struct passwd *user = getpwuid( uid ); | 100 | struct passwd *user = getpwuid( uid ); | ||
86 | if ( user ) | 101 | if ( user ) | ||
87 | str = user->pw_name; | 102 | str = user->pw_name; | ||
▲ Show 20 Lines • Show All 586 Lines • Show Last 20 Lines |