Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for getStatvfs #3994

Merged
merged 6 commits into from
Oct 4, 2024
Merged

Conversation

Martin-Zeithaml
Copy link
Contributor

@Martin-Zeithaml Martin-Zeithaml commented Sep 16, 2024

Please check if your PR fulfills the following requirements. This is simply a reminder of what we are going to look for before merging your PR. If you don't know all of this information when you create this PR, don't worry. You can edit this template as you're working on it.

  • DCO signoffs have been added to all commits, including this PR

PR type

What type of changes does your PR introduce to Zowe? Put an x in the box that applies to this PR. If you're unsure about any of them, don't hesitate to ask.

  • Feature

Relevant issues

Fixes #807

Changes proposed in this PR

Javascript function to simply detect the file system flags - useful when fs is mounted with nosetuid option).

Does this PR introduce a breaking change?

  • No

Test

import * as zosfs from '/zowe/bin/libs/zos-fs';
import * as shell from '/zowe/bin/libs/shell';

function runStatvfs(path) {
    const result = zosfs.getFileSystemFlags(`${path}`);
    if (result.rc == 0) {
        for (const [key, value] of Object.entries(result)) {
            if (typeof value == 'boolean') {
                let msg = `  ${key} -> ${value}`
                if (value) {
                    msg = msg.toUpperCase();
                }
                console.log(msg);
            }
        }
    }
}

function mountTestUnmount(fs, mp, sOptions) {
    console.log(`FS=${fs} with ${sOptions == '' ? 'no -s flag' : sOptions}`);
    shell.execSync('sh', '-c', `mount -t ZFS -f ${fs} ${sOptions} -o aggrgrow ${mp}`);
    runStatvfs(mp);
    shell.execSync('sh', '-c', `unmount ${mp}`);
}

const S_OPTION = [ '', '-s nosetuid', '-s nosecurity'];

for (let so in S_OPTION) {
    mountTestUnmount('ZOWE.ZFS', '/mnt/test', S_OPTION[so]);
}

console.log('Root fs should be read only');
runStatvfs('/');
FS=ZOWE.ZFS with no -s flag
  exported -> false
  rdonly -> false
  nosuid -> false
  nosecurity -> false
FS=ZOWE.ZFS with -s nosetuid
  exported -> false
  rdonly -> false
  NOSUID -> TRUE
  nosecurity -> false
FS=ZOWE.ZFS with -s nosecurity
  exported -> false
  rdonly -> false
  NOSUID -> TRUE
  NOSECURITY -> TRUE
Root fs should be read only
  exported -> false
  RDONLY -> TRUE
  nosuid -> false
  nosecurity -> false

Signed-off-by: Martin Zeithaml <[email protected]>
Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Sep 16, 2024

build 6047 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/10881751116

Copy link

github-actions bot commented Sep 16, 2024

Test workflow 5385 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.0.0-PR-3994/zowe-3.0.0-pr-3994-6047-20240916101919.pax
Running on machine: zzow07
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/10881866999

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Sep 16, 2024

build 6048 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/10882097370

Copy link

github-actions bot commented Sep 16, 2024

Test workflow 5386 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.0.0-PR-3994/zowe-3.0.0-pr-3994-6048-20240916104203.pax
Running on machine: zzow06
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/10882202994

Copy link

github-actions bot commented Sep 17, 2024

build 6048 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/10882097370

Copy link

github-actions bot commented Sep 17, 2024

Test workflow 5394 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.0.0-PR-3994/zowe-3.0.0-pr-3994-6048-20240917072237.pax
Running on machine: zzow08
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/10898418714

Copy link

github-actions bot commented Sep 17, 2024

build 6057 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/10905602351

Copy link

github-actions bot commented Sep 17, 2024

Test workflow 5396 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.0.0-PR-3994/zowe-3.0.0-pr-3994-6057-20240917150347.pax
Running on machine: zzow06
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/10905795058

Copy link

github-actions bot commented Sep 23, 2024

build 6131 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/10991343313

Copy link

github-actions bot commented Sep 23, 2024

Test workflow 5454 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.0.0-PR-3994/zowe-3.0.0-pr-3994-6131-20240923092629.pax
Running on machine: zzow07
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/10991445076

@Martin-Zeithaml Martin-Zeithaml changed the title Support for getStatvfs [DO NOT MERGE] Support for getStatvfs Sep 23, 2024
@MarkAckert MarkAckert added the Build: None Used in CI label Oct 4, 2024
@MarkAckert MarkAckert merged commit fdcdb26 into v3.x/staging Oct 4, 2024
7 of 8 checks passed
@MarkAckert MarkAckert deleted the v3.x/feature/checkFSforNOSUID branch October 4, 2024 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build: None Used in CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zFS for zssServer must be mounted with SETUID option
3 participants