Compare commits
6
Commits
54763a952c
...
132b75c2d0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
132b75c2d0 | ||
|
|
bc8f0f373e | ||
|
|
e352bfbb23 | ||
|
|
3ee6240806 | ||
|
|
304f94f3b1 | ||
|
|
89fa957297 |
Binary file not shown.
@@ -1527,7 +1527,11 @@ namespace Kernel
|
|||||||
uid_gid_t { m_credentials.euid(), m_credentials.egid() };
|
uid_gid_t { m_credentials.euid(), m_credentials.egid() };
|
||||||
});
|
});
|
||||||
|
|
||||||
auto [parent, file_name] = TRY(find_parent_file(fd, path, O_WRONLY));
|
auto [parent, file_name] = TRY(find_parent_file(fd, path, O_SEARCH));
|
||||||
|
if (!parent.inode->find_inode(file_name).is_error())
|
||||||
|
return BAN::Error::from_errno(EEXIST);
|
||||||
|
if (!parent.inode->can_access(m_credentials, O_WRONLY))
|
||||||
|
return BAN::Error::from_errno(EACCES);
|
||||||
TRY(parent.inode->create_directory(file_name, (mode & 0777) | Inode::Mode::IFDIR, uid, gid));
|
TRY(parent.inode->create_directory(file_name, (mode & 0777) | Inode::Mode::IFDIR, uid, gid));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+2
-2
@@ -10,8 +10,8 @@ CONFIGURE_OPTIONS=(
|
|||||||
'--without-bash-malloc'
|
'--without-bash-malloc'
|
||||||
'--with-curses'
|
'--with-curses'
|
||||||
'bash_cv_unusable_rtsigs=no'
|
'bash_cv_unusable_rtsigs=no'
|
||||||
'bash_cv_signal_vintage=posix'
|
'bash_cv_struct_winsize_termios=yes' # configure checks for sys/termios.h? code uses termios.h correctly
|
||||||
'CFLAGS=-std=c17'
|
'CFLAGS=-std=c17 -Wno-discarded-qualifiers'
|
||||||
'CFLAGS_FOR_BUILD=-std=c17'
|
'CFLAGS_FOR_BUILD=-std=c17'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
diff -ruN bash-5.2.37/examples/loadables/Makefile.in bash-5.2.37-banan_os/examples/loadables/Makefile.in
|
|
||||||
--- bash-5.2.37/examples/loadables/Makefile.in 2022-08-19 23:33:30.000000000 +0300
|
|
||||||
+++ bash-5.2.37-banan_os/examples/loadables/Makefile.in 2025-01-26 02:43:36.121801845 +0200
|
|
||||||
@@ -104,7 +104,7 @@
|
|
||||||
ALLPROG = print truefalse sleep finfo logname basename dirname fdflags \
|
|
||||||
tty pathchk tee head mkdir rmdir mkfifo mktemp printenv id whoami \
|
|
||||||
uname sync push ln unlink realpath strftime mypid setpgid seq rm \
|
|
||||||
- accept csv dsv cut stat getconf
|
|
||||||
+ accept csv dsv stat
|
|
||||||
OTHERPROG = necho hello cat pushd asort
|
|
||||||
|
|
||||||
all: $(SHOBJ_STATUS)
|
|
||||||
Executable
+10
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash ../install.sh
|
||||||
|
|
||||||
|
NAME='tar'
|
||||||
|
VERSION='1.35'
|
||||||
|
DOWNLOAD_URL="https://ftpmirror.gnu.org/gnu/tar/tar-$VERSION.tar.xz#4d62ff37342ec7aed748535323930c7cf94acf71c3591882b26a7ea50f3edc16"
|
||||||
|
CONFIG_SUB=('build-aux/config.sub')
|
||||||
|
|
||||||
|
pre_configure() {
|
||||||
|
echo '#include_next <sys/types.h>' > gnu/sys_types.in.h
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
diff -ruN tar-1.35/gnu/getprogname.c tar-1.35-banan_os/gnu/getprogname.c
|
||||||
|
--- tar-1.35/gnu/getprogname.c 2023-06-17 09:47:53.000000000 +0300
|
||||||
|
+++ tar-1.35-banan_os/gnu/getprogname.c 2026-07-07 15:22:32.468592615 +0300
|
||||||
|
@@ -50,7 +50,7 @@
|
||||||
|
# include <sys/procfs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#if defined __SCO_VERSION__ || defined __sysv5__
|
||||||
|
+#if defined __SCO_VERSION__ || defined __sysv5__ || defined __banan_os__
|
||||||
|
# include <fcntl.h>
|
||||||
|
# include <string.h>
|
||||||
|
#endif
|
||||||
|
@@ -265,7 +265,7 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
-# elif defined __SCO_VERSION__ || defined __sysv5__ /* SCO OpenServer6/UnixWare */
|
||||||
|
+# elif defined __SCO_VERSION__ || defined __sysv5__ || defined __banan_os__ /* SCO OpenServer6/UnixWare */
|
||||||
|
char buf[80];
|
||||||
|
int fd;
|
||||||
|
sprintf (buf, "/proc/%d/cmdline", getpid());
|
||||||
@@ -127,6 +127,7 @@ int vsnprintf(char* __restrict s, size_t n, const char* __restrict format, va_l
|
|||||||
int vsprintf(char* __restrict s, const char* __restrict format, va_list ap);
|
int vsprintf(char* __restrict s, const char* __restrict format, va_list ap);
|
||||||
int vsscanf(const char* __restrict s, const char* __restrict format, va_list arg);
|
int vsscanf(const char* __restrict s, const char* __restrict format, va_list arg);
|
||||||
|
|
||||||
|
size_t __fpending(FILE* stream);
|
||||||
void __fseterr(FILE* stream);
|
void __fseterr(FILE* stream);
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|||||||
@@ -134,6 +134,12 @@ void clearerr(FILE* file)
|
|||||||
file->error = false;
|
file->error = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t __fpending(FILE* file)
|
||||||
|
{
|
||||||
|
ScopeLock _(file);
|
||||||
|
return file->buffer_rd_size ? 0 : file->buffer_idx;
|
||||||
|
}
|
||||||
|
|
||||||
void __fseterr(FILE* file)
|
void __fseterr(FILE* file)
|
||||||
{
|
{
|
||||||
ScopeLock _(file);
|
ScopeLock _(file);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
static const char* s_argv0 { nullptr };
|
static const char* s_argv0 { nullptr };
|
||||||
|
|
||||||
bool create_parents(const char* path, bool verbose)
|
static bool create_parents(const char* path, bool verbose)
|
||||||
{
|
{
|
||||||
char buffer[PATH_MAX];
|
char buffer[PATH_MAX];
|
||||||
for (size_t i = 0; path[i];)
|
for (size_t i = 0; path[i];)
|
||||||
@@ -21,32 +21,47 @@ bool create_parents(const char* path, bool verbose)
|
|||||||
break;
|
break;
|
||||||
buffer[i] = '\0';
|
buffer[i] = '\0';
|
||||||
|
|
||||||
if (mkdir(buffer, 0) == -1)
|
struct stat st;
|
||||||
|
if (stat(path, &st) == 0)
|
||||||
{
|
{
|
||||||
if (errno == EEXIST)
|
if (S_ISDIR(st.st_mode))
|
||||||
continue;
|
continue;
|
||||||
|
fprintf(stderr, "%s: cannot create '%s': %s\n", s_argv0, path, strerror(EEXIST));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errno != ENOENT || mkdir(path, 0) == -1)
|
||||||
|
{
|
||||||
fprintf(stderr, "%s: cannot create '%s': %s\n", s_argv0, path, strerror(errno));
|
fprintf(stderr, "%s: cannot create '%s': %s\n", s_argv0, path, strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const mode_t filemask = umask(0);
|
|
||||||
umask(filemask);
|
|
||||||
|
|
||||||
chmod(buffer, (S_IWUSR | S_IXUSR | ~filemask) & 0777);
|
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf("%s: created directory '%s'\n", s_argv0, path);
|
printf("%s: created directory '%s'\n", s_argv0, path);
|
||||||
|
|
||||||
|
const mode_t filemask = umask(0);
|
||||||
|
umask(filemask);
|
||||||
|
chmod(buffer, (S_IWUSR | S_IXUSR | ~filemask) & 0777);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool create_directory(const char* path, mode_t mode, bool verbose, bool parents)
|
static bool create_directory(const char* path, mode_t mode, bool verbose, bool parents)
|
||||||
{
|
{
|
||||||
if (parents && !create_parents(path, verbose))
|
if (parents && !create_parents(path, verbose))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (mkdir(path, mode) == -1)
|
struct stat st;
|
||||||
|
if (stat(path, &st) == 0)
|
||||||
|
{
|
||||||
|
if (parents && S_ISDIR(st.st_mode))
|
||||||
|
return true;
|
||||||
|
fprintf(stderr, "%s: cannot create '%s': %s\n", s_argv0, path, strerror(EEXIST));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errno != ENOENT || mkdir(path, mode) == -1)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: cannot create '%s': %s\n", s_argv0, path, strerror(errno));
|
fprintf(stderr, "%s: cannot create '%s': %s\n", s_argv0, path, strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user