Skip to content

Commit

Permalink
[Server] Pad the octal mode returned by file stat to 4 characters.
Browse files Browse the repository at this point in the history
E.g.

- st_mode = 0    -> 0000
- st_mode = 1023 -> 1777
  • Loading branch information
simonmichal committed Jun 9, 2020
1 parent 1bb4af4 commit 2b806ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/XrdXrootd/XrdXrootdProtocol.cc
Expand Up @@ -699,7 +699,7 @@ int XrdXrootdProtocol::StatGen(struct stat &buf, char *xxBuff, int xxLen,
char *origP = xxBuff;
char *nullP = xxBuff + m++;
xxBuff += m; xxLen -= m;
n = snprintf(xxBuff, xxLen, "%ld %ld 0%o ",
n = snprintf(xxBuff, xxLen, "%ld %ld %04o ",
buf.st_ctime, buf.st_atime, buf.st_mode&07777);
if (n >= xxLen) return m;
xxBuff += n; xxLen -= n;
Expand Down

0 comments on commit 2b806ca

Please sign in to comment.