summaryrefslogtreecommitdiff
path: root/query.c
diff options
context:
space:
mode:
authorewt <devnull@localhost>1996-03-04 22:47:35 +0000
committerewt <devnull@localhost>1996-03-04 22:47:35 +0000
commit618ad69371b15a8f6fb8c9b9575d24126562b785 (patch)
treee44417878f463931a297be78aa96ee19a6cc2d3f /query.c
parent551f7b254077edf19667495344d9d3a3958b6085 (diff)
downloadlibrpm-tizen-618ad69371b15a8f6fb8c9b9575d24126562b785.tar.gz
librpm-tizen-618ad69371b15a8f6fb8c9b9575d24126562b785.tar.bz2
librpm-tizen-618ad69371b15a8f6fb8c9b9575d24126562b785.zip
prints SUID, SGID, sticky bits
CVS patchset: 455 CVS date: 1996/03/04 22:47:35
Diffstat (limited to 'query.c')
-rw-r--r--query.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/query.c b/query.c
index 48617eb2a..13bcca24a 100644
--- a/query.c
+++ b/query.c
@@ -198,7 +198,7 @@ static void printFileInfo(char * name, unsigned int size, unsigned short mode,
struct tm * tstruct;
char * namefield = name;
- strcpy(perms, "----------");
+ strcpy(perms, "-----------");
if (!thisYear) {
currenttime = time(NULL);
@@ -207,17 +207,33 @@ static void printFileInfo(char * name, unsigned int size, unsigned short mode,
thisMonth = tstruct->tm_mon;
}
- if (mode & S_IRUSR) perms[1]= 'r';
- if (mode & S_IWUSR) perms[2]= 'w';
- if (mode & S_IXUSR) perms[3]= 'x';
+ if (mode & S_ISVTX) perms[9] = 't';
- if (mode & S_IRGRP) perms[4]= 'r';
- if (mode & S_IWGRP) perms[5]= 'w';
- if (mode & S_IXGRP) perms[6]= 'x';
+ if (mode & S_IRUSR) perms[1] = 'r';
+ if (mode & S_IWUSR) perms[2] = 'w';
+ if (mode & S_IXUSR) perms[3] = 'x';
+
+ if (mode & S_IRGRP) perms[4] = 'r';
+ if (mode & S_IWGRP) perms[5] = 'w';
+ if (mode & S_IXGRP) perms[6] = 'x';
+
+ if (mode & S_IROTH) perms[7] = 'r';
+ if (mode & S_IWOTH) perms[8] = 'w';
+ if (mode & S_IXOTH) perms[9] = 'x';
+
+ if (mode & S_ISUID) {
+ if (mode & S_IXUSR)
+ perms[3] = 's';
+ else
+ perms[3] = 'S';
+ }
- if (mode & S_IROTH) perms[7]= 'r';
- if (mode & S_IWOTH) perms[8]= 'w';
- if (mode & S_IXOTH) perms[9]= 'x';
+ if (mode & S_ISGID) {
+ if (mode & S_IXGRP)
+ perms[6] = 's';
+ else
+ perms[6] = 'S';
+ }
if (owner)
strncpy(ownerfield, owner, 8);