icexin / eggos

A Go unikernel running on x86 bare metal
http://eggos.icexin.com
MIT License
2.23k stars 113 forks source link

fs: update afero to v1.8.1 #103

Closed mewmew closed 2 years ago

mewmew commented 2 years ago

In afero v1.6.0 the FromIOFS type was added (see afero.FromIOFS godoc), which facilitates interopability with the fs.FS interface of the Go standard library.

To support afero.FromIOFS in eggos, afero was updated to the latest version.

Note: the afero.FS interface has been updated since v1.4.0 to include the Chown method. As such, the logger, mount and smb file system types were updated to include the Chown method.

In particular, the fs/logger.logger, fs/mount.MountableFs and fs/stripprefix.fs file system types have been updated to include Chown.

However, as of yet, a stub implementation of Chown exist for the smb.Fs file system type.

mewmew commented 2 years ago

The CI build errors have been fixed now. The only thing left is to figure out how to handle smb.Chown:

From https://github.com/icexin/eggos/pull/103/files#diff-26b2456dc89ed2b4b08c32c9291200852506c7b778997d3f90d643429109b294R86:

// Chown changes the uid and gid of the named file.
func (f *Fs) Chown(name string, uid, gid int) error {
    panic("not implemented") // TODO: figure out how to implement.
}

Edit: does anyone have an idea of how to implement Chown for smb? I don't quite know how it is supposed to be handled.

icexin commented 2 years ago

Edit: does anyone have an idea of how to implement Chown for smb? I don't quite know how it is supposed to be handled.

There seems to be no chown semantics in the interface of the smb package. This place can simply report an error.

mewmew commented 2 years ago

There seems to be no chown semantics in the interface of the smb package. This place can simply report an error.

You're right. From https://pkg.go.dev/github.com/hirochachacha/go-smb2#section-readme:

This package doesn't support CAP_UNIX extension.

The CAP_UNIX would be required to handle uid/guid from what I can tell.

As of commit 00ae22454a8b2bbf23061c14779d4550c743879e, this PR is ready for review (and merge).

Cheers, Robin