laforge has submitted this change. ( https://gerrit.osmocom.org/c/dahdi-linux/+/42913?usp=email )
Change subject: Revert "Adjust to strncpy removal in linux 7.2-rc1" ......................................................................
Revert "Adjust to strncpy removal in linux 7.2-rc1"
There is another repository at https://github.com/asterisk/dahdi-linux that appears to be compatible to linux >= 2.6 and we want to in theory merge everything from our repo into that at some point. strscpy isn't available in such early linux versions yet, so revert commit b1bc81f8077c5cb52eae7fbd4021bf180159aed7 and add a different fix for building with 7.2-rc1 as next patch.
Related: https://gerrit.osmocom.org/c/dahdi-linux/+/42906/comments/c06cfbe4_fbd94c6e Change-Id: I71ad66d33b4a19e4cf9b431bcc3d3cd02cad5e2f --- M drivers/dahdi/dahdi-base.c M drivers/dahdi/xpp/mmapbus.c M drivers/dahdi/xpp/mmapdrv.c 3 files changed, 4 insertions(+), 4 deletions(-)
Approvals: laforge: Looks good to me, approved; Verified
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index 5067c02..657eb34 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -5449,7 +5449,7 @@ */ continue; } - strscpy(vi.echo_canceller, ec_name, sizeof(vi.echo_canceller)); + strncpy(vi.echo_canceller, ec_name, space); space -= strlen(ec_name); if (space < 1) break; diff --git a/drivers/dahdi/xpp/mmapbus.c b/drivers/dahdi/xpp/mmapbus.c index 72c402e..ddf083f 100644 --- a/drivers/dahdi/xpp/mmapbus.c +++ b/drivers/dahdi/xpp/mmapbus.c @@ -40,7 +40,7 @@ dev->dev.bus = &mmap_bus_type; dev->dev.parent = &mmap_bus; dev->dev.release = mmap_dev_release; - strscpy(dev->dev.bus_id, dev->name, sizeof(dev->dev.bus_id)); + strncpy(dev->dev.bus_id, dev->name, BUS_ID_SIZE); return device_register(&dev->dev); } EXPORT_SYMBOL(register_mmap_device); diff --git a/drivers/dahdi/xpp/mmapdrv.c b/drivers/dahdi/xpp/mmapdrv.c index 0124b92..2e0e298 100644 --- a/drivers/dahdi/xpp/mmapdrv.c +++ b/drivers/dahdi/xpp/mmapdrv.c @@ -572,8 +572,8 @@ ret = -ENOMEM; goto fail_xbus; } - strscpy(global_xbus->connector, "mmap", sizeof(global_xbus->connector)); - strscpy(global_xbus->label, "mmap:0", sizeof(global_xbus->label)); + strncpy(global_xbus->connector, "mmap", XBUS_DESCLEN); + strncpy(global_xbus->label, "mmap:0", LABEL_SIZE);
xframe_queue_init(&txpool, 10, 200, "mmap_txpool", global_xbus); if (!