Fix ncpserv, nwfile and nwshare warning hot spots

This commit is contained in:
Mario Fetka
2026-04-20 23:39:42 +02:00
parent 9087018b59
commit 8e8b837c63
3 changed files with 40 additions and 38 deletions

View File

@@ -193,10 +193,12 @@ int share_file(dev_t dev, ino_t inode, int open_mode, int action)
new_str(path_share_lock_files, buff);
else
new_str(path_share_lock_files, "/var/spool/nwserv/.locks");
seteuid(0);
if (seteuid(0))
return(-1);
unx_xmkdir(path_share_lock_files, 0755);
} else
seteuid(0);
if (seteuid(0))
return(-1);
l=sprintf(buff, "%s/%" PRIxMAX ".sm", path_share_lock_files,
(uintmax_t)dev);
sd->fd_sm = open(buff, O_RDWR|O_CREAT, 0600);