summaryrefslogtreecommitdiff
path: root/source/libsmb/smb_share_modes.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/libsmb/smb_share_modes.c')
-rw-r--r--source/libsmb/smb_share_modes.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/source/libsmb/smb_share_modes.c b/source/libsmb/smb_share_modes.c
index 89395fe373d..b63ec7ff78b 100644
--- a/source/libsmb/smb_share_modes.c
+++ b/source/libsmb/smb_share_modes.c
@@ -42,12 +42,12 @@ int smb_create_share_mode_entry_ex(struct smbdb_ctx *db_ctx, uint64_t dev,
uint64_t ino, const struct smb_share_mode_entry *new_entry,
const char *sharepath, const char *filename);
-static BOOL sharemodes_procid_equal(const struct server_id *p1, const struct server_id *p2)
+static BOOL sharemodes_procid_equal(const struct process_id *p1, const struct process_id *p2)
{
return (p1->pid == p2->pid);
}
-static pid_t sharemodes_procid_to_pid(const struct server_id *proc)
+static pid_t sharemodes_procid_to_pid(const struct process_id *proc)
{
return proc->pid;
}
@@ -101,7 +101,7 @@ static TDB_DATA get_locking_key(uint64_t dev, uint64_t ino)
memset(&lk, '\0', sizeof(struct locking_key));
lk.dev = (SMB_DEV_T)dev;
lk.inode = (SMB_INO_T)ino;
- ld.dptr = (uint8 *)&lk;
+ ld.dptr = (char *)&lk;
ld.dsize = sizeof(lk);
return ld;
}
@@ -137,8 +137,8 @@ static int share_mode_entry_equal(const struct smb_share_mode_entry *e_entry,
e_entry->open_time.tv_usec == entry->time.tv_usec &&
e_entry->share_access == (uint32_t)entry->share_access &&
e_entry->access_mask == (uint32_t)entry->access_mask &&
- e_entry->dev == entry->id.devid &&
- e_entry->ino == entry->id.inode);
+ e_entry->dev == (uint64_t)entry->dev &&
+ e_entry->ino == (uint64_t)entry->inode);
}
/*
@@ -156,8 +156,8 @@ static void create_share_mode_entry(struct share_mode_entry *out,
out->time.tv_usec = in->open_time.tv_usec;
out->share_access = in->share_access;
out->access_mask = in->access_mask;
- out->id.devid = in->dev;
- out->id.inode = in->ino;
+ out->dev = (SMB_DEV_T)in->dev;
+ out->inode = (SMB_INO_T)in->ino;
out->uid = (uint32)geteuid();
out->flags = 0;
}
@@ -211,7 +211,7 @@ int smb_get_share_mode_entries(struct smbdb_ctx *db_ctx,
for (i = 0; i < num_share_modes; i++) {
struct share_mode_entry *share = &shares[i];
struct smb_share_mode_entry *sme = &list[list_num];
- struct server_id pid = share->pid;
+ struct process_id pid = share->pid;
/* Check this process really exists. */
if (kill(sharemodes_procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) {
@@ -224,8 +224,8 @@ int smb_get_share_mode_entries(struct smbdb_ctx *db_ctx,
}
/* Copy into the external list. */
- sme->dev = share->id.devid;
- sme->ino = share->id.inode;
+ sme->dev = (uint64_t)share->dev;
+ sme->ino = (uint64_t)share->inode;
sme->share_access = (uint32_t)share->share_access;
sme->access_mask = (uint32_t)share->access_mask;
sme->open_time.tv_sec = share->time.tv_sec;
@@ -263,13 +263,13 @@ int smb_create_share_mode_entry_ex(struct smbdb_ctx *db_ctx,
int orig_num_share_modes = 0;
struct locking_data *ld = NULL; /* internal samba db state. */
struct share_mode_entry *shares = NULL;
- uint8 *new_data_p = NULL;
+ char *new_data_p = NULL;
size_t new_data_size = 0;
db_data = tdb_fetch(db_ctx->smb_tdb, locking_key);
if (!db_data.dptr) {
/* We must create the entry. */
- db_data.dptr = (uint8 *)malloc(
+ db_data.dptr = (char *)malloc(
sizeof(struct locking_data) +
sizeof(struct share_mode_entry) +
strlen(sharepath) + 1 +
@@ -305,7 +305,7 @@ int smb_create_share_mode_entry_ex(struct smbdb_ctx *db_ctx,
}
/* Entry exists, we must add a new entry. */
- new_data_p = (uint8 *)malloc(
+ new_data_p = (char *)malloc(
db_data.dsize + sizeof(struct share_mode_entry));
if (!new_data_p) {
free(db_data.dptr);
@@ -376,10 +376,10 @@ int smb_delete_share_mode_entry(struct smbdb_ctx *db_ctx,
int orig_num_share_modes = 0;
struct locking_data *ld = NULL; /* internal samba db state. */
struct share_mode_entry *shares = NULL;
- uint8 *new_data_p = NULL;
+ char *new_data_p = NULL;
size_t remaining_size = 0;
size_t i, num_share_modes;
- const uint8 *remaining_ptr = NULL;
+ const char *remaining_ptr = NULL;
db_data = tdb_fetch(db_ctx->smb_tdb, locking_key);
if (!db_data.dptr) {
@@ -403,7 +403,7 @@ int smb_delete_share_mode_entry(struct smbdb_ctx *db_ctx,
}
/* More than one - allocate a new record minus the one we'll delete. */
- new_data_p = (uint8 *)malloc(
+ new_data_p = (char *)malloc(
db_data.dsize - sizeof(struct share_mode_entry));
if (!new_data_p) {
free(db_data.dptr);
@@ -416,7 +416,7 @@ int smb_delete_share_mode_entry(struct smbdb_ctx *db_ctx,
num_share_modes = 0;
for (i = 0; i < orig_num_share_modes; i++) {
struct share_mode_entry *share = &shares[i];
- struct server_id pid = share->pid;
+ struct process_id pid = share->pid;
/* Check this process really exists. */
if (kill(sharemodes_procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) {
@@ -492,7 +492,7 @@ int smb_change_share_mode_entry(struct smbdb_ctx *db_ctx,
for (i = 0; i < num_share_modes; i++) {
struct share_mode_entry *share = &shares[i];
- struct server_id pid = share->pid;
+ struct process_id pid = share->pid;
/* Check this process really exists. */
if (kill(sharemodes_procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) {